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

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

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

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

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

示例1: GetEntityId

void CCinematicWeapon::StopFire(){	BaseClass::StopFire();	m_fireSound.Stop( GetEntityId() );	m_stopFireTailSound.Play( GetEntityId() );}
开发者ID:Xydrel,项目名称:Infected,代码行数:7,


示例2: GetGameObject

//------------------------------------------------------------------------void CItem::InitClient(int channelId){	// send the differences between the current, and the initial setup	for(TAccessoryMap::iterator it=m_accessories.begin(); it != m_accessories.end(); ++it)		GetGameObject()->InvokeRMI(ClAttachAccessory(), RequestAttachAccessoryParams(it->first.c_str()), eRMI_ToClientChannel, channelId);	IActor *pOwner=GetOwnerActor();	if(!pOwner)		return;	// only send the pickup message if the player is connecting	// for items spawned during gameplay, CItem::PickUp is already sending the pickup message	INetChannel *pNetChannel=m_pGameFramework->GetNetChannel(channelId);	if(pNetChannel && pNetChannel->GetContextViewState()<eCVS_InGame)	{		if(!m_stats.mounted && !m_stats.used)		{			pOwner->GetGameObject()->InvokeRMIWithDependentObject(CActor::ClPickUp(),					CActor::PickItemParams(GetEntityId(), m_stats.selected, false), eRMI_ToClientChannel, GetEntityId(), channelId);			//GetOwnerActor()->GetGameObject()->InvokeRMI(CActor::ClPickUp(),			//	CActor::PickItemParams(GetEntityId(), m_stats.selected, false), eRMI_ToClientChannel, channelId);		}	}	if(m_stats.mounted && m_stats.used)	{		pOwner->GetGameObject()->InvokeRMIWithDependentObject(CActor::ClStartUse(),				CActor::ItemIdParam(GetEntityId()), eRMI_ToClientChannel, GetEntityId(), channelId);	}}
开发者ID:Hellraiser666,项目名称:CryGame,代码行数:33,


示例3: hudEvent

void CC4Projectile::SetupUIIcon(){	if(GetEntityId())	{		const bool dangerous = !m_OnSameTeam || g_pGame->GetGameRules()->GetFriendlyFireRatio() > 0.f;		//If the C4 can't harm us we show a C4 icon (ThreatAwareness shows enemy C4 as well)		const CPlayer* pPlayer = static_cast<CPlayer*>(gEnv->pGame->GetIGameFramework()->GetClientActor());		const bool shouldShow = !dangerous;		if(shouldShow && !m_isShowingUIIcon)		{			SHUDEvent hudEvent(eHUDEvent_OnC4Spawned);			hudEvent.AddData((int)GetEntityId());			hudEvent.AddData((bool)dangerous);			CHUDEventDispatcher::CallEvent(hudEvent);			m_isShowingUIIcon = true;		}		else if(m_isShowingUIIcon && !shouldShow)		{			SHUDEvent hudEvent(eHUDEvent_RemoveC4Icon);			hudEvent.AddData((int)GetEntityId());			CHUDEventDispatcher::CallEvent(hudEvent);			m_isShowingUIIcon = false;		}	}}
开发者ID:Xydrel,项目名称:Infected,代码行数:25,


示例4: ConstructShape

	void ConstructShape(float frameOffset)	{		CmpPtr<ICmpPosition> cmpPosition(GetSimContext(), GetEntityId());		if (!cmpPosition)			return;		if (!cmpPosition->IsInWorld())			return;		float x, z, rotY;		cmpPosition->GetInterpolatedPosition2D(frameOffset, x, z, rotY);		CmpPtr<ICmpFootprint> cmpFootprint(GetSimContext(), GetEntityId());		if (!cmpFootprint)		{			// Default (this probably shouldn't happen) - just render an arbitrary-sized circle			SimRender::ConstructCircleOnGround(GetSimContext(), x, z, 2.f, m_Overlay, cmpPosition->IsFloating());		}		else		{			ICmpFootprint::EShape shape;			entity_pos_t size0, size1, height;			cmpFootprint->GetShape(shape, size0, size1, height);			if (shape == ICmpFootprint::SQUARE)				SimRender::ConstructSquareOnGround(GetSimContext(), x, z, size0.ToFloat(), size1.ToFloat(), rotY, m_Overlay, cmpPosition->IsFloating());			else				SimRender::ConstructCircleOnGround(GetSimContext(), x, z, size0.ToFloat(), m_Overlay, cmpPosition->IsFloating());		}	}
开发者ID:Gallaecio,项目名称:0ad,代码行数:30,


示例5: ProcessEvent

	virtual void ProcessEvent(EFlowEvent event, SActivationInfo *pActInfo)	{		switch(event)		{		case eFE_Initialize:			m_actInfo = *pActInfo;			CMiniMapInfo::GetInstance()->UpdateLevelInfo();			m_entityId = GetEntityId(pActInfo);			break;		case eFE_Activate:			if(IsPortActive(pActInfo, eI_Trigger))				TriggerPorts(pActInfo);			if(IsPortActive(pActInfo, eI_Disable))				UnRegisterEntity();			if(IsPortActive(pActInfo, eI_Enable))			{				UnRegisterEntity();				m_entityId = GetEntityId(pActInfo);				RegisterEntity();			}			break;		}	}
开发者ID:Hellraiser666,项目名称:CryGame,代码行数:27,


示例6: assert

//------------------------------------------------------------------------void CVehicleWeapon::StartUse(EntityId userId){	if (m_ownerId && userId != m_ownerId)		return;   if (GetEntity()->GetParent())  {     m_pVehicle = gEnv->pGame->GetIGameFramework()->GetIVehicleSystem()->GetVehicle(GetEntity()->GetParent()->GetId());    assert(m_pVehicle && "Using VehicleWeapons on non-vehicles may lead to unexpected behavior.");    if (m_pVehicle)    {         m_pPart = m_pVehicle->GetWeaponParentPart(GetEntityId());       m_pOwnerSeat = m_pVehicle->GetWeaponParentSeat(GetEntityId());      m_pSeatUser = m_pVehicle->GetSeatForPassenger(userId);    }  }  	SetOwnerId(userId);  Select(true);		m_stats.used = true;	EnableUpdate(true, eIUS_General);	RequireUpdate(eIUS_General);  if (OutOfAmmo(false))    Reload(false);  UseManualBlending(true);	LowerWeapon(false);	SendMusicLogicEvent(eMUSICLOGICEVENT_WEAPON_MOUNT);}
开发者ID:kitnet,项目名称:crynegine,代码行数:36,


示例7: HandleMessage

	virtual void HandleMessage(const CMessage& msg, bool UNUSED(global))	{		switch (msg.GetType())		{		case MT_PositionChanged:		{			if (!m_Active)				break;			const CMessagePositionChanged& data = static_cast<const CMessagePositionChanged&> (msg);			if (!data.inWorld && !m_Tag.valid())				break; // nothing needs to change			CmpPtr<ICmpObstructionManager> cmpObstructionManager(GetSimContext(), SYSTEM_ENTITY);			if (!cmpObstructionManager)				break; // error			if (data.inWorld && m_Tag.valid())			{				cmpObstructionManager->MoveShape(m_Tag, data.x, data.z, data.a);			}			else if (data.inWorld && !m_Tag.valid())			{				// Need to create a new pathfinder shape:				if (m_Type == STATIC)					m_Tag = cmpObstructionManager->AddStaticShape(GetEntityId(),						data.x, data.z, data.a, m_Size0, m_Size1, m_Flags, m_ControlGroup, m_ControlGroup2);				else					m_Tag = cmpObstructionManager->AddUnitShape(GetEntityId(),						data.x, data.z, m_Size0, (flags_t)(m_Flags | (m_Moving ? ICmpObstructionManager::FLAG_MOVING : 0)), m_ControlGroup);			}			else if (!data.inWorld && m_Tag.valid())			{				cmpObstructionManager->RemoveShape(m_Tag);				m_Tag = tag_t();			}			break;		}		case MT_Destroy:		{			if (m_Tag.valid())			{				CmpPtr<ICmpObstructionManager> cmpObstructionManager(GetSimContext(), SYSTEM_ENTITY);				if (!cmpObstructionManager)					break; // error				cmpObstructionManager->RemoveShape(m_Tag);				m_Tag = tag_t();			}			break;		}		}	}
开发者ID:TiriliPiitPiit,项目名称:0ad,代码行数:54,


示例8: Init

	virtual void Init(const CParamNode& paramNode)	{		m_PreviouslyRendered = false;		m_Unit = NULL;		m_Visibility = ICmpRangeManager::VIS_HIDDEN;		m_R = m_G = m_B = fixed::FromInt(1);		if (!GetSimContext().HasUnitManager())			return; // do nothing further if graphics are disabled		// TODO: we should do some fancy animation of under-construction buildings rising from the ground,		// but for now we'll just use the foundation actor and ignore the normal one		if (paramNode.GetChild("Foundation").IsOk() && paramNode.GetChild("FoundationActor").IsOk())			m_ActorName = paramNode.GetChild("FoundationActor").ToString();		else			m_ActorName = paramNode.GetChild("Actor").ToString();		std::set<CStr> selections;		m_Unit = GetSimContext().GetUnitManager().CreateUnit(m_ActorName, GetActorSeed(), selections);		if (m_Unit)		{			CModelAbstract& model = m_Unit->GetModel();			if (model.ToCModel())			{				u32 modelFlags = 0;				if (paramNode.GetChild("SilhouetteDisplay").ToBool())					modelFlags |= MODELFLAG_SILHOUETTE_DISPLAY;				if (paramNode.GetChild("SilhouetteOccluder").ToBool())					modelFlags |= MODELFLAG_SILHOUETTE_OCCLUDER;				CmpPtr<ICmpVision> cmpVision(GetSimContext(), GetEntityId());				if (cmpVision && cmpVision->GetAlwaysVisible())					modelFlags |= MODELFLAG_IGNORE_LOS;				model.ToCModel()->AddFlagsRec(modelFlags);			}			// Initialize the model's selection shape descriptor. This currently relies on the component initialization order; the 			// Footprint component must be initialized before this component (VisualActor) to support the ability to use the footprint			// shape for the selection box (instead of the default recursive bounding box). See TypeList.h for the order in			// which components are initialized; if for whatever reason you need to get rid of this dependency, you can always just			// initialize the selection shape descriptor on-demand.			InitSelectionShapeDescriptor(model, paramNode);			m_Unit->SetID(GetEntityId());		}		SelectAnimation("idle", false, fixed::FromInt(1), L"");	}
开发者ID:stonefruit,项目名称:0ad,代码行数:52,


示例9: SetActive

	virtual void SetActive(bool active)	{		if (active && !m_Active)		{			m_Active = true;			// Construct the obstruction shape			CmpPtr<ICmpObstructionManager> cmpObstructionManager(GetSystemEntity());			if (!cmpObstructionManager)				return; // error			CmpPtr<ICmpPosition> cmpPosition(GetEntityHandle());			if (!cmpPosition)				return; // error			if (!cmpPosition->IsInWorld())				return; // don't need an obstruction			// TODO: code duplication from message handlers			CFixedVector2D pos = cmpPosition->GetPosition2D();			if (m_Type == STATIC)				m_Tag = cmpObstructionManager->AddStaticShape(GetEntityId(),					pos.X, pos.Y, cmpPosition->GetRotation().Y, m_Size0, m_Size1, m_Flags, m_ControlGroup, m_ControlGroup2);			else if (m_Type == UNIT)				m_Tag = cmpObstructionManager->AddUnitShape(GetEntityId(),					pos.X, pos.Y, m_Size0, m_Clearance, (flags_t)(m_Flags | (m_Moving ? ICmpObstructionManager::FLAG_MOVING : 0)), m_ControlGroup);			else 				AddClusterShapes(pos.X, pos.Y, cmpPosition->GetRotation().Y);		}		else if (!active && m_Active)		{			m_Active = false;			// Delete the obstruction shape			// TODO: code duplication from message handlers			if (m_Tag.valid())			{				CmpPtr<ICmpObstructionManager> cmpObstructionManager(GetSystemEntity());				if (!cmpObstructionManager)					return; // error				cmpObstructionManager->RemoveShape(m_Tag);				m_Tag = tag_t();				if (m_Type == CLUSTER)					RemoveClusterShapes();			}		}		// else we didn't change the active status	}
开发者ID:zxbstrong,项目名称:0ad,代码行数:51,


示例10:

//------------------------------------------------------------------------CClaymore::~CClaymore(){	if(gEnv->bMultiplayer && gEnv->bServer)	{		IActor *pOwner = g_pGame->GetIGameFramework()->GetIActorSystem()->GetActor(m_ownerId);		if(pOwner && pOwner->IsPlayer())		{			((CPlayer*)pOwner)->RecordExplosiveDestroyed(GetEntityId(), 0);		}	}	if(g_pGame->GetHUD())		g_pGame->GetHUD()->RecordExplosiveDestroyed(GetEntityId());}
开发者ID:RenEvo,项目名称:dead6,代码行数:15,


示例11: dir

//------------------------------------------------------------------------void CRock::HandleEvent(const SGameObjectEvent &event){	CProjectile::HandleEvent(event);	if (event.event == eGFE_OnCollision)	{		if (m_destroying)			return;		EventPhysCollision *pCollision = reinterpret_cast<EventPhysCollision *>(event.ptr);		if (!pCollision)			return;		IEntity *pTarget = pCollision->iForeignData[1]==PHYS_FOREIGN_ID_ENTITY ? (IEntity*)pCollision->pForeignData[1]:0;		if (!pTarget || pTarget->GetId()==m_ownerId || pTarget->GetId()==GetEntityId())			return;		Vec3 dir(0, 0, 0);		if (pCollision->vloc[0].GetLengthSquared() > 1e-6f)			dir = pCollision->vloc[0].GetNormalized();		CGameRules *pGameRules = g_pGame->GetGameRules();		HitInfo hitInfo(m_ownerId, pTarget?pTarget->GetId():0, m_weaponId,			m_fmId, 0.0f, pGameRules->GetHitMaterialIdFromSurfaceId(pCollision->idmat[1]), pCollision->partid[1],			pGameRules->GetHitTypeId("melee"), pCollision->pt, dir, pCollision->n);		hitInfo.remote = IsRemote();		hitInfo.projectileId = GetEntityId();		if (!hitInfo.remote)			hitInfo.seq=m_seq;		hitInfo.damage = m_damage;		if (m_weaponId)		{			CWeapon *pWeapon=GetWeapon();			if (pWeapon && pWeapon->GetForcedHitMaterial() != -1)				hitInfo.material=pGameRules->GetHitMaterialIdFromSurfaceId(pWeapon->GetForcedHitMaterial());		}		pGameRules->ClientHit(hitInfo);		if(m_damage>10)			m_damage =(int)(m_damage*0.5f);	}}
开发者ID:mrwonko,项目名称:CrysisVR,代码行数:49,


示例12: GetActor

//=========================================bool CRocketLauncher::CanPickUp(EntityId userId) const{	CActor *pActor = GetActor(userId);	IInventory *pInventory=GetActorInventory(pActor);	if (m_sharedparams->params.pickable && m_stats.pickable && !m_stats.flying && !m_frozen &&(!m_ownerId || m_ownerId==userId) && !m_stats.selected && !GetEntity()->IsHidden())	{		if (pInventory && pInventory->FindItem(GetEntityId())!=-1)			return false;	}	else		return false;	uint8 uniqueId = m_pItemSystem->GetItemUniqueId(GetEntity()->GetClass()->GetName());	//Can not pick up a LAW while I have one already 	if(pInventory && (pInventory->GetCountOfUniqueId(uniqueId)>0))	{		if(pActor->IsClient())			g_pGame->GetGameRules()->OnTextMessage(eTextMessageCenter, "@mp_CannotCarryMoreLAW");		return false;	}	return true;		}
开发者ID:nhnam,项目名称:Seasons,代码行数:27,


示例13: InstallProceduralClip

void CActionScope::InstallProceduralClip(const SProceduralEntry &proc, int layer, const SAnimBlend &blend, float duration){    SProcSequencer &procSeq = m_procSequencers[layer];    if (procSeq.proceduralClip)    {        procSeq.proceduralClip->OnExit(blend.duration);        procSeq.proceduralClip.reset();    }    if (proc.type != 0)    {        CryCreateClassInstance<IProceduralClip>(proc.typeString.c_str(), procSeq.proceduralClip);        if (procSeq.proceduralClip)        {            const char *contextName = procSeq.proceduralClip->GetContextName();            if (contextName)            {                IProceduralContext *context = m_actionController.FindOrCreateProceduralContext(contextName);                procSeq.proceduralClip->SetContext(context);            }            IEntity* pEntity = gEnv->pEntitySystem->GetEntity(GetEntityId()); // TODO: Handle invalid entity!            procSeq.proceduralClip->Initialise(*pEntity, *GetCharInst(), *this, *m_pAction);            procSeq.proceduralClip->INTERNAL_OnEnter(blend.duration, duration, *((SProceduralParams*)&proc.animRef));        }    }}
开发者ID:souxiaosou,项目名称:FireNET,代码行数:28,


示例14: RenderSubmit

	void RenderSubmit(SceneCollector& collector)	{		// (This is only called if a > 0)		collector.Submit(&m_Overlay);		if (ICmpSelectable::ms_EnableDebugOverlays)		{			// allocate debug overlays on-demand			if (!m_DebugBoundingBoxOverlay) m_DebugBoundingBoxOverlay = new SOverlayLine;			if (!m_DebugSelectionBoxOverlay) m_DebugSelectionBoxOverlay = new SOverlayLine;			CmpPtr<ICmpVisual> cmpVisual(GetSimContext(), GetEntityId()); 			if (cmpVisual) 			{				SimRender::ConstructBoxOutline(cmpVisual->GetBounds(), *m_DebugBoundingBoxOverlay);				m_DebugBoundingBoxOverlay->m_Thickness = 2; 				m_DebugBoundingBoxOverlay->m_Color = CColor(1.f, 0.f, 0.f, 1.f);				SimRender::ConstructBoxOutline(cmpVisual->GetSelectionBox(), *m_DebugSelectionBoxOverlay);				m_DebugSelectionBoxOverlay->m_Thickness = 2;				m_DebugSelectionBoxOverlay->m_Color = CColor(0.f, 1.f, 0.f, 1.f);				collector.Submit(m_DebugBoundingBoxOverlay);				collector.Submit(m_DebugSelectionBoxOverlay);			}		}		else		{			// reclaim debug overlay line memory when no longer debugging (and make sure to set to zero after deletion)			if (m_DebugBoundingBoxOverlay) SAFE_DELETE(m_DebugBoundingBoxOverlay);			if (m_DebugSelectionBoxOverlay) SAFE_DELETE(m_DebugSelectionBoxOverlay);		}	}
开发者ID:Gallaecio,项目名称:0ad,代码行数:33,


示例15: ZapEnemiesOnPuddle

void CWaterPuddle::ZapEnemiesOnPuddle(int ownTeam, EntityId shooterId, EntityId weaponId, float damage, int hitTypeId, IParticleEffect* hitEffect){	IGameVolumes::VolumeInfo volumeInfo;	if (!GetVolumeInfoForEntity(GetEntityId(), &volumeInfo))		return;	IEntity* pEntity = GetEntity();	Matrix34 worldTM = pEntity->GetWorldTM();	float waterLevel = worldTM.GetTranslation().z + volumeInfo.volumeHeight * 0.5f;	CActorManager* pActorManager = CActorManager::GetActorManager();	const int numberOfActors	= pActorManager->GetNumActors();	for(int i = 0; i < numberOfActors; i++)	{		SActorData actorData;		pActorManager->GetNthActorData(i, actorData);		bool isActorAlive = (actorData.health > 0.0f);		bool isActorEnemy = (actorData.teamId != ownTeam);		bool isActorInsidevolume = IsActorInsideVolume(worldTM, volumeInfo, actorData.entityId);		if (isActorAlive && isActorEnemy && isActorInsidevolume)			ApplyHit(actorData, shooterId, weaponId, damage, hitTypeId, waterLevel, hitEffect);	}}
开发者ID:Kufusonic,项目名称:Work-in-Progress-Sonic-Fangame,代码行数:25,


示例16: assert

//----------------------------------------------------------------------void CVehicleMountedWeapon::PerformRipOff(CActor* pOwner){	IActionMapManager* pMapManager = gEnv->pGame->GetIGameFramework()->GetIActionMapManager();	assert(pMapManager);	pMapManager->EnableActionMap("vehicle_general", false);	IVehicle *pVehicle = gEnv->pGame->GetIGameFramework()->GetIVehicleSystem()->GetVehicle(m_vehicleId);	if(pVehicle)	{		SVehicleEventParams params;		params.entityId = GetEntityId();		pVehicle->BroadcastVehicleEvent(eVE_WeaponRemoved, params);		if(pOwner)		{			if(gEnv->bMultiplayer)			{				const IEntity* pVehicleEnt = pVehicle->GetEntity();				IEntity* pEntity		  = pOwner->GetEntity(); 				const Matrix34& vehWMat   = pVehicleEnt->GetWorldTM(); 				m_previousWSpaceOffsetPosition = pEntity->GetWorldPos();				m_localRipUserOffset = vehWMat.GetInverted().TransformPoint(m_previousWSpaceOffsetPosition); 			}			pOwner->LinkToVehicle(0);		}		m_previousVehicleRotation = pVehicle->GetEntity()->GetWorldRotation();	}	CHeavyMountedWeapon::PerformRipOff(pOwner);}
开发者ID:amrhead,项目名称:eaascode,代码行数:34,


示例17: GetOwnerActor

//------------------------------------------------------------------------void CVehicleMountedWeapon::StartUse(EntityId userId){	IVehicle *pVehicle = gEnv->pGame->GetIGameFramework()->GetIVehicleSystem()->GetVehicle(m_vehicleId);	if (!IsRippingOff() && pVehicle)	{ 		m_pOwnerSeat = pVehicle->GetWeaponParentSeat(GetEntityId());		m_pSeatUser = pVehicle->GetSeatForPassenger(userId);		IActor* pOwner = GetOwnerActor();		if (pOwner && !pOwner->IsPlayer())		{			SHUDEvent hudEvent(eHUDEvent_AddEntity);			hudEvent.AddData((int)pVehicle->GetEntityId());			CHUDEventDispatcher::CallEvent(hudEvent);		}		ClearItemFlags(eIF_InformClientsAboutUse); 	}	CHeavyMountedWeapon::StartUse(userId);	CActor* pActor = GetOwnerActor();	if (pActor && pActor->IsPlayer())	{		static_cast<CPlayer*>(pActor)->RefreshVisibilityState();	}}
开发者ID:amrhead,项目名称:eaascode,代码行数:28,


示例18: Hide

//------------------------------------------------------------------------void CItem::RemoveEntity(bool force){	if(gEnv->IsEditor() && !force)		Hide(true);	else if(IsServer() || force)		gEnv->pEntitySystem->RemoveEntity(GetEntityId());}
开发者ID:Hellraiser666,项目名称:CryGame,代码行数:8,


示例19: GetEntityId

void CReplayActor::SetTeam( int8 team, const bool isFriendly ){	m_team = team;	m_isFriendly = isFriendly;	// Local, because it only exists locally.	g_pGame->GetGameRules()->SetTeam(team, GetEntityId(), true);}
开发者ID:Kufusonic,项目名称:Work-in-Progress-Sonic-Fangame,代码行数:7,


示例20: GetActor

bool CJaw::CanPickUp(EntityId userId) const{	CActor *pActor = GetActor(userId);	IInventory *pInventory=GetActorInventory(pActor);	if (m_sharedparams->params.pickable && m_stats.pickable && !m_stats.flying && (!m_owner.GetId() || m_owner.GetId()==userId) && !m_stats.selected && !GetEntity()->IsHidden())	{		if (pInventory && pInventory->FindItem(GetEntityId())!=-1)			return false;	}	else		return false;	if(GetAmmoCount(m_fm->GetAmmoType())<=0)	{		return false;	}	uint8 uniqueId = m_pItemSystem->GetItemUniqueId(GetEntity()->GetClass()->GetName());	int maxNumRockets = GetWeaponSharedParams()->ammoParams.capacityAmmo[0].count;	if(pInventory && (pInventory->GetCountOfUniqueId(uniqueId)>=maxNumRockets))	{		if(pActor->IsClient())		{			SHUDEventWrapper::DisplayInfo(eInfo_Warning, 0.5f, "@mp_CannotCarryMoreLAW");		}		return false;	}	return true;		}
开发者ID:amrhead,项目名称:eaascode,代码行数:34,


示例21: GetEntityId

void CC4Projectile::SetParams(const SProjectileDesc& projectileDesc){	if(CGameRules* pGameRules = g_pGame->GetGameRules())	{		if(projectileDesc.ownerId) //Can be 0 for late joiners		{			m_teamId = pGameRules->GetTeam(projectileDesc.ownerId);			// if this is a team game, record which team placed this claymore...			if(gEnv->bServer)			{				pGameRules->SetTeam(m_teamId, GetEntityId());			}			if(!gEnv->IsDedicated())			{				const EntityId clientId = g_pGame->GetIGameFramework()->GetClientActorId();				int localPlayerTeam = pGameRules->GetTeam( clientId );				m_OnSameTeam = m_teamId ? m_teamId == localPlayerTeam : clientId == projectileDesc.ownerId;				if(gEnv->bServer)				{					CreateLight();				}				if(gEnv->bMultiplayer)				{					SetupUIIcon();				}			}		}	}		CProjectile::SetParams(projectileDesc);}
开发者ID:Xydrel,项目名称:Infected,代码行数:35,


示例22: stim

void CProjectile::FlashbangEffect(const SFlashbangParams *flashbang){	if(!flashbang)		return;	const float radius = flashbang->maxRadius;	if(!gEnv->pAISystem)		return;	// Associate event with vehicle if the shooter is in a vehicle (tank cannon shot, etc)	EntityId ownerId = m_ownerId;	IActor *pActor = g_pGame->GetIGameFramework()->GetIActorSystem()->GetActor(ownerId);	if(pActor && pActor->GetLinkedVehicle() && pActor->GetLinkedVehicle()->GetEntityId())		ownerId = pActor->GetLinkedVehicle()->GetEntityId();	SAIStimulus stim(AISTIM_GRENADE, AIGRENADE_FLASH_BANG, ownerId, GetEntityId(),					 GetEntity()->GetWorldPos(), ZERO, radius);	gEnv->pAISystem->RegisterStimulus(stim);	SAIStimulus stimSound(AISTIM_SOUND, AISOUND_WEAPON, ownerId, 0,						  GetEntity()->GetWorldPos(), ZERO, radius * 3.0f);	gEnv->pAISystem->RegisterStimulus(stimSound);}
开发者ID:Hellraiser666,项目名称:CryGame,代码行数:25,


示例23: SAFE_HUD_FUNC

//------------------------------------------------------------------------void CProjectile::SetTracked(bool tracked){	if (m_tracked!=tracked)	{		if (tracked)		{			SAFE_HUD_FUNC(AddTrackedProjectile(GetEntityId()));		}		else		{			SAFE_HUD_FUNC(RemoveTrackedProjectile(GetEntityId()));		}		m_tracked=tracked;	}}
开发者ID:mrwonko,项目名称:CrysisVR,代码行数:17,


示例24: GetEntity

EntityId CAICorpse::CloneAttachedItem( const CAICorpse::AttachedItem& attachedItem, IAttachment* pAttachment  ){	stack_string clonedItemName;	clonedItemName.Format("%s_%s", GetEntity()->GetName(), attachedItem.pClass->GetName() );	SEntitySpawnParams params;	params.sName = clonedItemName.c_str();	params.pClass = attachedItem.pClass;	// Flag as 'No Save' they will be recreated during serialization if needed	params.nFlags |= (ENTITY_FLAG_NO_SAVE);					IEntity *pClonedItemEntity = gEnv->pEntitySystem->SpawnEntity(params);	assert (pClonedItemEntity != NULL);	IItem* pClonedItem = g_pGame->GetIGameFramework()->GetIItemSystem()->GetItem(pClonedItemEntity->GetId());	assert(pClonedItem != NULL);	pClonedItem->Physicalize(false, false);	pClonedItem->SetOwnerId( GetEntityId() );	// Set properties table to null, since they'll not be used	IScriptTable* pClonedItemEntityScript = pClonedItemEntity->GetScriptTable();	if (pClonedItemEntityScript != NULL)	{		pClonedItemEntity->GetScriptTable()->SetToNull("Properties");	}	// Swap attachments	CEntityAttachment* pEntityAttachement = new CEntityAttachment();	pEntityAttachement->SetEntityId( pClonedItemEntity->GetId() );	pAttachment->AddBinding( pEntityAttachement );	return pClonedItemEntity->GetId();}
开发者ID:aronarts,项目名称:FireNET,代码行数:35,



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


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