您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GetUID函数代码示例

51自学网 2021-06-01 21:17:02
  C++
这篇教程C++ GetUID函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中GetUID函数的典型用法代码示例。如果您正苦于以下问题:C++ GetUID函数的具体用法?C++ GetUID怎么用?C++ GetUID使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了GetUID函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: CheckReceiveThreads

	// This function should be only ran when the temporary buffer size is not 0 (otherwise, data is copied directly to the threads)	bool CheckReceiveThreads()	{		SortReceiveThreads();		bool wokeThreads = false;		bool freedSpace = false;		while (!receiveWaitingThreads.empty() && GetUsedSize() > 0)		{			MsgPipeWaitingThread *thread = &receiveWaitingThreads.front();			// Receive as much as possible, even if it's not enough to wake up.			u32 bytesToSend = std::min(thread->freeSize, GetUsedSize());			thread->WriteBuffer(Memory::GetPointer(buffer), bytesToSend);			// Put the unused data at the start of the buffer.			nmp.freeSize += bytesToSend;			memmove(Memory::GetPointer(buffer), Memory::GetPointer(buffer) + bytesToSend, GetUsedSize());			freedSpace = true;			if (thread->waitMode == SCE_KERNEL_MPW_ASAP || thread->freeSize == 0)			{				thread->Complete(GetUID(), 0);				receiveWaitingThreads.erase(receiveWaitingThreads.begin());				wokeThreads = true;				thread = NULL;			}			// Stop at the first that can't wake up.			else				break;		}		if (freedSpace)			wokeThreads |= CheckSendThreads();		return wokeThreads;	}
开发者ID:PewnyPL,项目名称:ppsspp,代码行数:36,


示例2: CheckSendThreads

	bool CheckSendThreads()	{		SortSendThreads();		bool wokeThreads = false;		bool filledSpace = false;		while (!sendWaitingThreads.empty() && nmp.freeSize > 0)		{			MsgPipeWaitingThread *thread = &sendWaitingThreads.front();			u32 bytesToSend = std::min(thread->freeSize, (u32) nmp.freeSize);			thread->ReadBuffer(Memory::GetPointer(buffer + GetUsedSize()), bytesToSend);			nmp.freeSize -= bytesToSend;			filledSpace = true;			if (thread->waitMode == SCE_KERNEL_MPW_ASAP || thread->freeSize == 0)			{				thread->Complete(GetUID(), 0);				sendWaitingThreads.erase(sendWaitingThreads.begin());				wokeThreads = true;				thread = NULL;			}			// Unlike receives, we don't do partial sends.  Stop at first blocked thread.			else				break;		}		if (filledSpace)			wokeThreads |= CheckReceiveThreads();		return wokeThreads;	}
开发者ID:PewnyPL,项目名称:ppsspp,代码行数:32,


示例3: jack_shmalloc

/* allocate a POSIX shared memory segment */intjack_shmalloc (const char *shm_name, jack_shmsize_t size, jack_shm_info_t* si){	jack_shm_registry_t* registry;	int shm_fd;	int rc = -1;	char name[SHM_NAME_MAX+1];	if (jack_shm_lock_registry () < 0) {        jack_error ("jack_shm_lock_registry fails...");        return -1;    }	if ((registry = jack_get_free_shm_info ()) == NULL) {		jack_error ("shm registry full");		goto unlock;	}	/* On Mac OS X, the maximum length of a shared memory segment	 * name is SHM_NAME_MAX (instead of NAME_MAX or PATH_MAX as	 * defined by the standard).  Unfortunately, Apple sets this	 * value so small (about 31 bytes) that it is useless for	 * actual names.  So, we construct a short name from the	 * registry index for uniqueness and ignore the shm_name	 * parameter.  Bah!	 */	snprintf (name, sizeof (name), "/jack-%d-%d", GetUID(), registry->index);	if (strlen (name) >= sizeof (registry->id)) {		jack_error ("shm segment name too long %s", name);		goto unlock;	}	if ((shm_fd = shm_open (name, O_RDWR|O_CREAT, 0666)) < 0) {		jack_error ("Cannot create shm segment %s (%s)",			    name, strerror (errno));		goto unlock;	}	if (ftruncate (shm_fd, size) < 0) {		jack_error ("Cannot set size of engine shm "			    "registry 0 (%s)",			    strerror (errno));		close (shm_fd);		goto unlock;	}	close (shm_fd);	registry->size = size;	strncpy (registry->id, name, sizeof (registry->id));	registry->allocator = GetPID();	si->index = registry->index;	si->ptr.attached_at = MAP_FAILED;	/* not attached */	rc = 0;				/* success */ unlock:	jack_shm_unlock_registry ();	return rc;}
开发者ID:AndrewCooper,项目名称:jack2,代码行数:60,


示例4: getNormalOfControlSurfaceDevice

PNamedShape CCPACSControlSurfaceDevice::getFlapShape(){    PNamedShape loft =  outerShape.GetLoft(                _segment->GetWing().GetWingCleanShape(),                getNormalOfControlSurfaceDevice());    loft->SetName(GetUID().c_str());    return loft;}
开发者ID:DLR-SC,项目名称:tigl,代码行数:8,


示例5: SortThreads

	void SortThreads(std::vector<MsgPipeWaitingThread> &waitingThreads, bool usePrio)	{		// Clean up any not waiting at the same time.		HLEKernel::CleanupWaitingThreads(WAITTYPE_MSGPIPE, GetUID(), waitingThreads);		if (usePrio)			std::stable_sort(waitingThreads.begin(), waitingThreads.end(), __KernelMsgPipeThreadSortPriority);	}
开发者ID:libretro,项目名称:PSP1,代码行数:8,


示例6: ADDTOCALLSTACK

void CItemSpawn::AddObj(CGrayUID uid){	ADDTOCALLSTACK("CitemSpawn:AddObj");	// NOTE: This function is also called when loading spawn items	// on server startup. In this case, some objs UID still invalid	// (not loaded yet) so just proceed without any checks.	bool bIsSpawnChar = IsType(IT_SPAWN_CHAR);	if ( !g_Serv.IsLoading() )	{		if ( !uid.IsValidUID() )			return;		if ( bIsSpawnChar )				// IT_SPAWN_CHAR can only spawn NPCs		{			CChar *pChar = uid.CharFind();			if ( !pChar || !pChar->m_pNPC )				return;		}		else if ( !uid.ItemFind() )		// IT_SPAWN_ITEM can only spawn items			return;		CItemSpawn *pPrevSpawn = static_cast<CItemSpawn*>(uid.ObjFind()->m_uidSpawnItem.ItemFind());		if ( pPrevSpawn )		{			if ( pPrevSpawn == this )		// obj already linked to this spawn				return;			pPrevSpawn->DelObj(uid);		// obj linked to other spawn, remove the link before proceed		}	}	BYTE iMax = maximum(GetAmount(), 1);	for (BYTE i = 0; i < iMax; i++ )	{		if ( !m_obj[i].IsValidUID() )		{			m_obj[i] = uid;			m_currentSpawned++;			// objects are linked to the spawn at each server start			if ( !g_Serv.IsLoading() )			{				uid.ObjFind()->m_uidSpawnItem = GetUID();				if ( bIsSpawnChar )				{					CChar *pChar = uid.CharFind();					ASSERT(pChar->m_pNPC);					pChar->StatFlag_Set(STATF_Spawned);					pChar->m_ptHome = GetTopPoint();					pChar->m_pNPC->m_Home_Dist_Wander = static_cast<WORD>(m_itSpawnChar.m_DistMax);				}			}			break;		}	}	if ( !g_Serv.IsLoading() )		ResendTooltip();}
开发者ID:DarkLotus,项目名称:Source,代码行数:58,


示例7: SetDirection

void ZActor::Attack_Range(rvector& dir){	m_Animation.Input(ZA_INPUT_ATTACK_RANGE);	SetDirection(dir);	rvector pos;	pos = m_Position + rvector(0, 0, 100);	ZPostNPCRangeShot(GetUID(), g_pGame->GetTime(), pos, pos + 10000.f*dir, MMCIP_PRIMARY);}
开发者ID:Asunaya,项目名称:RefinedGunz,代码行数:9,


示例8: LOG_DEBUG

int       Session::Kick(int reason){    if(GetState() == Session::PLAYER_STATE_KICKING )    {        return -1;    }    LOG_DEBUG("kick uid = %lu reason = %u [maybe todo notify reason]",GetUID(),reason);    if(player)    {        player->Detach();    }    sessionMgr->GetLoginLogic().Logout(sessionMgr->GetSession(GetUID()));    //-----------------------------------------------------------------    ResponseClient(gate::GateSSMsg::EVENT_CLOSE,                   gate::GateSSMsg::CONNECTION_CLOSE_BY_DEFAULT);     SetState(Session::PLAYER_STATE_KICKING);    return 0;}
开发者ID:jj4jj,项目名称:playground,代码行数:18,


示例9: LOG

PNamedShape CTiglAbstractGeometricComponent::GetLoft(void){    if (!(loft)) {#ifdef DEBUG        LOG(INFO) << "Building loft " << GetUID();#endif        loft = BuildLoft();    }    return loft;}
开发者ID:hyper123,项目名称:tigl,代码行数:10,


示例10: ASSERT

bool CItemMulti::Multi_IsPartOf( const CItem * pItem ) const{	// Assume it is in my area test already.	// IT_MULTI	// IT_SHIP	ASSERT( pItem );	if ( pItem == this )		return( true );	return ( pItem->m_uidLink == GetUID());}
开发者ID:GenerationOfWorlds,项目名称:Sphere,代码行数:10,


示例11: GetMACAdress

/***********************************************************************************************************	函 数 名: GetMACAdress*	功能说明: 获取设备MAC地址。MAC地址前面三个地址是IEEE给ST公司分配的数据*	形    参: 将MAC地址写入mac指针*	返 回 值: 无**********************************************************************************************************/void  GetMACAdress(uint8_t *mac) {	uint8_t uid[12];	GetUID(uid); 	mac[0]=MAC0;	mac[1]=MAC1;	mac[2]=MAC2;	mac[3]=uid[0]^uid[3]^uid[6]^uid[9];	mac[4]=uid[1]^uid[4]^uid[7]^uid[10];	mac[5]=uid[2]^uid[5]^uid[8]^uid[11];}   
开发者ID:dasuimao,项目名称:DTS-2500_HMI0030_BOOT,代码行数:19,


示例12: GetTopSector

void CItem::Spawn_GenerateChar( CResourceDef * pDef ){	if ( ! IsTopLevel())		return;	// creatures can only be top level.	if ( m_itSpawnChar.m_current >= GetAmount())		return;	int iComplexity = GetTopSector()->GetCharComplexity();	if ( iComplexity > g_Cfg.m_iMaxCharComplexity )	{		DEBUG_MSG(( "Spawn uid=0%lx too complex (%d>%d)/n", GetUID(), iComplexity, g_Cfg.m_iMaxCharComplexity ));		return;	}	int iDistMax = m_itSpawnChar.m_DistMax;	RESOURCE_ID_BASE rid = pDef->GetResourceID();	if ( rid.GetResType() == RES_SPAWN )	{		const CRandGroupDef * pSpawnGroup = STATIC_CAST <const CRandGroupDef *>(pDef);		ASSERT(pSpawnGroup);		int i = pSpawnGroup->GetRandMemberIndex();		if ( i >= 0 )		{			rid = pSpawnGroup->GetMemberID(i);		}	}		CREID_TYPE id;	if ( rid.GetResType() == RES_CHARDEF || 		rid.GetResType() == RES_UNKNOWN )	{		id = (CREID_TYPE) rid.GetResIndex();	}	else	{		return;	}	CChar * pChar = CChar::CreateNPC( id );	if ( pChar == NULL )		return;	ASSERT(pChar->m_pNPC);	m_itSpawnChar.m_current ++;	pChar->Memory_AddObjTypes( this, MEMORY_ISPAWNED );	// Move to spot "near" the spawn item.	pChar->MoveNearObj( this, iDistMax );	if ( iDistMax )	{		pChar->m_ptHome = GetTopPoint();		pChar->m_pNPC->m_Home_Dist_Wander = iDistMax;	}	pChar->Update();}
开发者ID:GenerationOfWorlds,项目名称:Sphere,代码行数:53,


示例13: jack_error

    int Shm::shmalloc (const char * /*shm_name*/, jack_shmsize_t size, jack_shm_info_t* si) {        jack_shm_registry_t* registry;        int shm_fd;        int rc = -1;        char name[SHM_NAME_MAX+1];         if (shm_lock_registry () < 0) {           jack_error ("jack_shm_lock_registry fails...");           return -1;        }		sp<IAndroidShm> service = getShmService();		if(service == NULL){			rc = errno;			jack_error("shm service is null");			goto unlock;		}         if ((registry = get_free_shm_info ()) == NULL) {           jack_error ("shm registry full");           goto unlock;        }        snprintf (name, sizeof (name), "/jack-%d-%d", GetUID(), registry->index);        if (strlen (name) >= sizeof (registry->id)) {           jack_error ("shm segment name too long %s", name);           goto unlock;        }        if((shm_fd = service->allocShm(size)) < 0) {           rc = errno;           jack_error ("Cannot create shm segment %s", name);           goto unlock;        }                //close (shm_fd);        registry->size = size;        strncpy (registry->id, name, sizeof (registry->id) - 1);        registry->id[sizeof (registry->id) - 1] = '/0';        registry->allocator = GetPID();        registry->fd = shm_fd;        si->fd = shm_fd;        si->index = registry->index;        si->ptr.attached_at = MAP_FAILED;  /* not attached */        rc = 0;  /* success */                jack_d ("[APA] jack_shmalloc : ok ");unlock:        shm_unlock_registry ();        return rc;    }
开发者ID:jackaudio,项目名称:jack2,代码行数:52,


示例14: jack_set_server_prefix

/* set a unique per-user, per-server shm prefix string * * According to the POSIX standard: * *   "The name argument conforms to the construction rules for a *   pathname. If name begins with the slash character, then processes *   calling shm_open() with the same value of name refer to the same *   shared memory object, as long as that name has not been *   removed. If name does not begin with the slash character, the *   effect is implementation-defined. The interpretation of slash *   characters other than the leading slash character in name is *   implementation-defined." * * Since the Linux implementation does not allow slashes *within* the * name, in the interest of portability we use colons instead. */static voidjack_set_server_prefix (const char *server_name){#ifdef WIN32    char buffer[UNLEN+1]={0};    DWORD len = UNLEN+1;    GetUserName(buffer, &len);    snprintf (jack_shm_server_prefix, sizeof (jack_shm_server_prefix),		  "jack-%s:%s:", buffer, server_name);#else    snprintf (jack_shm_server_prefix, sizeof (jack_shm_server_prefix),		  "jack-%d:%s:", GetUID(), server_name);#endif}
开发者ID:AndrewCooper,项目名称:jack2,代码行数:30,


示例15: GetConfiguration

// get short name for loftstd::string CCPACSFuselage::GetShortShapeName (){    unsigned int findex = 0;    for (int i = 1; i <= GetConfiguration().GetFuselageCount(); ++i) {        tigl::CCPACSFuselage& f = GetConfiguration().GetFuselage(i);        if (GetUID() == f.GetUID()) {            findex = i;            std::stringstream shortName;            shortName << "F" << findex;            return shortName.str();        }    }    return "UNKNOWN";}
开发者ID:gstariarch,项目名称:tigl,代码行数:15,


示例16: DoCycle

void CHSAsteroid::DoCycle(void){	CHSObject *cObj;	CHSUniverse *uSrc;	CHSShip *Target;	int idx;	double dDistance;			  uSrc = uaUniverses.FindUniverse(GetUID());	  if (!uSrc)		  return;		  // Grab all of the objects in the universe, and see if they're in the area.	  for (idx = 0; idx < HS_MAX_OBJECTS; idx++)	  {		  cObj = uSrc->GetUnivObject(idx);		  if (!cObj)			  continue;		  if (cObj->GetType() != HST_SHIP)			  continue;		  Target = (CHSShip *) cObj;		  dDistance = Dist3D(GetX(),GetY(),GetZ(),Target->GetX(),Target->GetY(),Target->GetZ());		  		  if (dDistance > GetSize() * 100)			  continue;		  if (GetDensity() < getrandom(50 / Target->GetSize() * ((Target->GetSpeed() + 1) / 1000)))			  continue;		  int strength;		  strength = getrandom(GetDensity() * Target->GetSize() * ((Target->GetSpeed() + 1) / 1000));		  Target->m_hull_points -= strength;		  Target->NotifySrooms("The ship shakes as asteroids impact on the hull");		  	// Is hull < 0?			if (Target->m_hull_points < 0)			{				Target->ExplodeMe();				if (!hsInterface.HasFlag(m_objnum, TYPE_THING, THING_HSPACE_SIM))					Target->KillShipCrew("THE SHIP EXPLODES!!");			} 	  }}
开发者ID:TinyMUSH,项目名称:Historical-TinyMUSH-hspace,代码行数:50,


示例17: PrintUID

/***********************************************************************************************************	函 数 名: PrintUID*	功能说明: 串口打印UID信息*	形    参: 无*	返 回 值: 无**********************************************************************************************************/void PrintUID(void){	#ifdef	UID_DEBUG 	uint8_t i;	uint8_t uid[12];	GetUID(uid);	printf("UID =%X",uid[0]);	for(i=1;i<12;i++)	{		printf("-%X",uid[i]);	} 	printf("H/r/n");	#endif	}  
开发者ID:dasuimao,项目名称:DTS-2500_HMI0030_BOOT,代码行数:22,


示例18: GetUID

int CUT_POP3Client::GetUID(LPWSTR uid, size_t maxSize, int msgNumber, size_t *size) {	int retval;		if(maxSize > 0) {		char * uidA = new char [maxSize];				if(uidA != NULL) {			retval = GetUID( uidA, maxSize, msgNumber, size);						if(retval == UTE_SUCCESS) {				CUT_Str::cvtcpy(uid, maxSize, uidA);			}						delete [] uidA;					}		else {			retval = UTE_OUT_OF_MEMORY;		}	}	else {		if(size == NULL) (retval = UTE_NULL_PARAM);		else {			LPCSTR lpStr = GetUID(msgNumber);			if(lpStr != NULL) {				*size = strlen(lpStr)+1;				retval = UTE_BUFFER_TOO_SHORT;			}			else {				retval = UTE_INDEX_OUTOFRANGE;			}		}	}	return retval;}
开发者ID:Omgan,项目名称:RealFTP.net,代码行数:37,


示例19: CreateTemplate

bool CItemMulti::Multi_CreateComponent( ITEMID_TYPE id, int dx, int dy, int dz, DWORD dwKeyCode ){	CItem * pItem = CreateTemplate( id );	ASSERT(pItem);	CPointMap pt = GetTopPoint();	pt.m_x += dx;	pt.m_y += dy;	pt.m_z += dz;	bool fNeedKey = false;	switch ( pItem->GetType() )	{	case IT_KEY:	// it will get locked down with the house ?	case IT_SIGN_GUMP:	case IT_SHIP_TILLER:		pItem->m_itKey.m_lockUID.SetPrivateUID( dwKeyCode );	// Set the key id for the key/sign.		fNeedKey = true;		break;	case IT_DOOR:		pItem->SetType(IT_DOOR_LOCKED);fNeedKey = true;		break;	case IT_CONTAINER:		pItem->SetType(IT_CONTAINER_LOCKED);fNeedKey = true;		break;	case IT_SHIP_SIDE:		pItem->SetType(IT_SHIP_SIDE_LOCKED);		break;	case IT_SHIP_HOLD:		pItem->SetType(IT_SHIP_HOLD_LOCK);		break;	}	pItem->SetAttr( ATTR_MOVE_NEVER | (m_Attr&(ATTR_MAGIC|ATTR_INVIS)));	pItem->SetHue( GetHue());	pItem->m_uidLink = GetUID();	// lock it down with the structure.	if ( pItem->IsTypeLockable() || pItem->IsTypeLocked())	{		pItem->m_itContainer.m_lockUID.SetPrivateUID( dwKeyCode );	// Set the key id for the door/key/sign.		pItem->m_itContainer.m_lock_complexity = 10000;	// never pickable.	}	pItem->MoveTo( pt );	return( fNeedKey );}
开发者ID:GenerationOfWorlds,项目名称:Sphere,代码行数:49,


示例20: ADDTOCALLSTACK

bool CItemStone::CheckValidMember( CStoneMember * pMember ){	ADDTOCALLSTACK("CItemStone::CheckValidMember");	ASSERT(pMember);	ASSERT( pMember->GetParent() == this );	if ( GetAmount()==0 || g_Serv.m_iExitFlag )	// no reason to elect new if the stone is dead.		return( true );	// we are deleting anyhow.	switch ( pMember->GetPriv())	{		case STONEPRIV_MASTER:		case STONEPRIV_MEMBER:		case STONEPRIV_CANDIDATE:		case STONEPRIV_ACCEPTED:			if ( GetMemoryType())			{				// Make sure the member has a memory that links them back here.				CChar * pChar = pMember->GetLinkUID().CharFind();				if ( pChar == NULL )					break;				if ( pChar->Guild_Find( GetMemoryType()) != this )					break;			}			return( true );		case STONEPRIV_ENEMY:			{				CItemStone * pEnemyStone = dynamic_cast <CItemStone *>( pMember->GetLinkUID().ItemFind());				if ( pEnemyStone == NULL )					break;				CStoneMember * pEnemyMember = pEnemyStone->GetMember(this);				if ( pEnemyMember == NULL )					break;				if ( pMember->GetWeDeclared() && ! pEnemyMember->GetTheyDeclared())					break;				if ( pMember->GetTheyDeclared() && ! pEnemyMember->GetWeDeclared())					break;			}			return( true );		default:			break;	}	// just delete this member. (it is mislinked)	DEBUG_ERR(( "Stone UID=0%lx has mislinked member uid=0%lx/n", 		(DWORD) GetUID(), (DWORD) pMember->GetLinkUID()));	return( false );}
开发者ID:WangXYZ,项目名称:SphereServer_Source,代码行数:49,


示例21: SaveData

void IntersectItem::SaveData( int nParentID ){		if( GetUID() >=0 )	{		CString strSQL;		GetUpdateSQL(strSQL);		CADODatabase::ExecuteSQLStatement(strSQL);	}	else // insert data	{			CString strSQL;		GetInsertSQL(nParentID, strSQL);		m_nUID = CADODatabase::ExecuteSQLStatementAndReturnScopeID(strSQL);	}	}
开发者ID:chenbk85,项目名称:tphProjects,代码行数:15,


示例22: snprintf

    char* JackTools::UserDir()    {        static char user_dir[JACK_PATH_MAX + 1] = "";        /* format the path name on the first call */        if (user_dir[0] == '/0') {            if (getenv ("JACK_PROMISCUOUS_SERVER")) {                snprintf(user_dir, sizeof(user_dir), "%s/jack", jack_tmpdir);            } else {                snprintf(user_dir, sizeof(user_dir), "%s/jack-%d", jack_tmpdir, GetUID());            }        }        return user_dir;    }
开发者ID:arthurtofani,项目名称:ensemble,代码行数:15,


示例23: Position

// Return false if the entity is to be destroyedbool CAmmoEntity::Update(TFloat32 updateTime){	if (!landed)	{		Position().y -= m_FallSpeed * updateTime;		if (Position().y < m_Height)		{			landed = true;		}	}	else	{		m_SinWave += updateTime;		Position().y = m_Height + sin(m_SinWave);		// Rotate on the spot and bob up and down (for effect)		Matrix().RotateY((kfPi / 3) * updateTime);	}	//TODO: Collision detection	TInt32 enumID;	EntityManager.BeginEnumEntities(enumID, "", "", "Tank");	CTankEntity* theTank = dynamic_cast<CTankEntity*> (EntityManager.EnumEntity(enumID));	while (theTank)	{		float radius = Template()->Mesh()->BoundingRadius();		if (Length(Position() - theTank->Position()) < (theTank->GetRadius() + radius))	//If distance between the ammo and the tank is less than the tank's radius		{			EntityManager.EndEnumEntities(enumID);			// Hit the tank, send the hit message and destroy the bullet			SMessage theCollectMessage;			theCollectMessage.from = GetUID();			theCollectMessage.type = Msg_Ammo;			theCollectMessage.intParam = m_RefillSize;			Messenger.SendMessageA(theTank->GetUID(), theCollectMessage);			return false;		}		theTank = dynamic_cast<CTankEntity*> (EntityManager.EnumEntity(enumID));	}	EntityManager.EndEnumEntities(enumID);	return true;}
开发者ID:pocketninja25,项目名称:TankAssignment,代码行数:49,


示例24: Calc_GetRandVal

void CItem::Spawn_OnTick( bool fExec ){	int iMinutes;	if ( m_itSpawnChar.m_TimeHiMin <= 0 )	{		iMinutes = Calc_GetRandVal(30) + 1;	}	else	{		iMinutes = min( m_itSpawnChar.m_TimeHiMin, m_itSpawnChar.m_TimeLoMin ) + Calc_GetRandVal( abs( m_itSpawnChar.m_TimeHiMin - m_itSpawnChar.m_TimeLoMin ));	}	if ( iMinutes <= 0 )		iMinutes = 1;	if ( !fExec || IsTimerExpired() )	{		SetTimeout( iMinutes * 60 * TICK_PER_SEC );	// set time to check again.	}	if ( ! fExec )		return;	CResourceDef * pDef = Spawn_FixDef();	if ( pDef == NULL )	{		RESOURCE_ID_BASE rid;		if ( IsType(IT_SPAWN_ITEM))		{			rid = m_itSpawnItem.m_ItemID;		}		else		{			rid = m_itSpawnChar.m_CharID;		}		DEBUG_ERR(( "Bad Spawn point uid=0%lx, id=%s/n", (DWORD) GetUID(), g_Cfg.ResourceGetName(rid) ));		return;	}	if ( IsType(IT_SPAWN_ITEM))	{		Spawn_GenerateItem(pDef);	}	else	{		Spawn_GenerateChar(pDef);	}}
开发者ID:GenerationOfWorlds,项目名称:Sphere,代码行数:48,


示例25: ADDTOCALLSTACK

CChar *CItemCorpse::IsCorpseSleeping() const{	ADDTOCALLSTACK("CItemCorpse::IsCorpseSleeping");	// Is this corpse really a sleeping person ?	// CItemCorpse	if ( !IsType(IT_CORPSE) )	{		DEBUG_ERR(("Corpse (0%x) doesn't have type T_CORPSE! (it has %d)/n", (dword)GetUID(), GetType()));		return NULL;	}	CChar *pCharCorpse = m_uidLink.CharFind();	if ( pCharCorpse && pCharCorpse->IsStatFlag(STATF_Sleeping) && !GetTimeStamp().IsTimeValid() )		return pCharCorpse;	return NULL;}
开发者ID:nefthon,项目名称:Source,代码行数:17,


示例26: GetImageStatisticsWithImageConnected

  void GetImageStatisticsWithImageConnected()  {    //create rules connection    auto statisticsNode = mitk::CreateImageStatisticsNode(m_statisticsContainer, "testStatistics");    CreateNodeRelationImage(m_statisticsContainer.GetPointer(), m_image.GetPointer());    auto standaloneDataStorage = mitk::StandaloneDataStorage::New();    standaloneDataStorage->Add(statisticsNode);    //rule: (image-->statistics), 1 connected image --> test return image statistics    mitk::ImageStatisticsContainer::ConstPointer statisticsWithImage;    CPPUNIT_ASSERT_NO_THROW(statisticsWithImage = mitk::ImageStatisticsContainerManager::GetImageStatistics(standaloneDataStorage.GetPointer(), m_image.GetPointer()));    CPPUNIT_ASSERT_EQUAL(statisticsWithImage->GetUID(), m_statisticsContainer->GetUID());    //new rule: (image2-->statistics2 AND mask --> statistics2)    CreateNodeRelationImage(m_statisticsContainer2.GetPointer(), m_image2.GetPointer());    CreateNodeRelationMask(m_statisticsContainer2.GetPointer(), m_mask.GetPointer());    auto statisticsNode2 = mitk::CreateImageStatisticsNode(m_statisticsContainer2, "testStatistics2");    standaloneDataStorage->Add(statisticsNode2);    //--> test return (still) image statistics (!= statistics2)    mitk::ImageStatisticsContainer::ConstPointer statisticsWithImageAgain;    CPPUNIT_ASSERT_NO_THROW(statisticsWithImageAgain = mitk::ImageStatisticsContainerManager::GetImageStatistics(standaloneDataStorage.GetPointer(), m_image.GetPointer()));    CPPUNIT_ASSERT_EQUAL(statisticsWithImageAgain->GetUID(), m_statisticsContainer->GetUID());    CPPUNIT_ASSERT_EQUAL(statisticsWithImageAgain->GetUID() != m_statisticsContainer2->GetUID(), true);    //--> test return image statistics 2    CPPUNIT_ASSERT_NO_THROW(statisticsWithImageAgain = mitk::ImageStatisticsContainerManager::GetImageStatistics(standaloneDataStorage.GetPointer(), m_image2.GetPointer(), m_mask.GetPointer()));    CPPUNIT_ASSERT_EQUAL(statisticsWithImageAgain->GetUID(), m_statisticsContainer2->GetUID());    CPPUNIT_ASSERT_EQUAL(statisticsWithImageAgain->GetUID() != m_statisticsContainer->GetUID(), true);    //add another newer statistic: should return this newer one    auto statisticsContainerNew = mitk::ImageStatisticsContainer::New();    CreateNodeRelationImage(statisticsContainerNew.GetPointer(), m_image.GetPointer());    auto statisticsNodeNew = mitk::CreateImageStatisticsNode(statisticsContainerNew, "testStatisticsNew");    standaloneDataStorage->Add(statisticsNodeNew);    statisticsContainerNew->Modified();    mitk::ImageStatisticsContainer::ConstPointer statisticsWithImageNew;    CPPUNIT_ASSERT_NO_THROW(statisticsWithImageNew = mitk::ImageStatisticsContainerManager::GetImageStatistics(standaloneDataStorage.GetPointer(), m_image.GetPointer()));    CPPUNIT_ASSERT_EQUAL(statisticsWithImageNew->GetUID(), statisticsContainerNew->GetUID());    CPPUNIT_ASSERT_EQUAL(statisticsWithImageNew->GetUID() != m_statisticsContainer->GetUID(), true);  }
开发者ID:Cdebus,项目名称:MITK,代码行数:44,


示例27: AddStage

bool MMatchChannel::AddStage(MMatchStage* pStage){	if (m_UnusedStageIndexList.empty()) return false;	int nRecommendedStageIndex = *(m_UnusedStageIndexList.begin());	m_UnusedStageIndexList.pop_front();	if ((nRecommendedStageIndex < 0) || (nRecommendedStageIndex > m_nMaxStages)) return false;	pStage->SetOwnerChannel(GetUID(), nRecommendedStageIndex);	if (m_pStages[nRecommendedStageIndex] != NULL)	{		_ASSERT(0);	}	m_pStages[nRecommendedStageIndex] = pStage;	return true;}
开发者ID:Asunaya,项目名称:RefinedGunz,代码行数:19,



注:本文中的GetUID函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ GetUInt32Value函数代码示例
C++ GetU16函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。