这篇教程C++ GetTeam函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetTeam函数的典型用法代码示例。如果您正苦于以下问题:C++ GetTeam函数的具体用法?C++ GetTeam怎么用?C++ GetTeam使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetTeam函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: switch//--------------------------------------------------------------------------------------// Checks whether the necessary conditions for the execution of a certain manoeuvre are // still given// Param1: Identifies the manoeuvre, for which to check the conditions.// Returns true if the conditions for the manoeuvre are still fulfilled, false otherwise.//--------------------------------------------------------------------------------------bool MultiflagCTFTeamAI::ManoeuvreStillValid(TeamManoeuvreType manoeuvre){ EntityTeam enemyTeam = None; if(GetTeam() == TeamRed) { enemyTeam = TeamBlue; }else { enemyTeam = TeamRed; } switch(manoeuvre) { case DefendBaseEntrancesManoeuvre: return (m_flagData[GetTeam()].m_state == InBase); break; case RushBaseAttackManoeuvre: return (m_flagData[enemyTeam].m_state == InBase); break; case CoordinatedBaseAttackManoeuvre: return (m_flagData[enemyTeam].m_state == InBase); break; case DistractionBaseAttackManoeuvre: return (m_flagData[enemyTeam].m_state == InBase); break; case SimpleBaseAttackManoeuvre: return (m_flagData[enemyTeam].m_state == InBase); break; case PickUpDroppedFlagManoeuvre: return (m_flagData[enemyTeam].m_state == Dropped); break; case RunTheFlagHomeManoeuvre: return (m_flagData[enemyTeam].m_state == Stolen); break; case ReturnDroppedFlagManoeuvre: return (m_flagData[GetTeam()].m_state == Dropped); break; case SimpleBaseDefenceManoeuvre: return (m_flagData[GetTeam()].m_state == InBase); break; case ActiveBaseDefenceManoeuvre: return (m_flagData[GetTeam()].m_state == InBase); break; case GuardedFlagCaptureManoeuvre: return (m_flagData[enemyTeam].m_state == Stolen); break; case InterceptFlagCarrierManoeuvre: return (m_flagData[GetTeam()].m_state == Stolen); break; default: return TeamAI::ManoeuvreStillValid(manoeuvre); }}
开发者ID:BlurEffect,项目名称:SquadAI,代码行数:59,
示例2: ifvoid CObject::HandleSpecialSegment (void){if ((info.nType == OBJ_PLAYER) && (gameData.multiplayer.nLocalPlayer == info.nId)) { CSegment* segP = SEGMENTS + info.nSegment; CPlayerData* playerP = gameData.multiplayer.players + gameData.multiplayer.nLocalPlayer; fix shields, fuel; if (gameData.app.nGameMode & GM_CAPTURE) segP->CheckForGoal (); else if (gameData.app.nGameMode & GM_HOARD) segP->CheckForHoardGoal (); else if (Controls [0].forwardThrustTime || Controls [0].verticalThrustTime || Controls [0].sidewaysThrustTime) { gameStates.entropy.nTimeLastMoved = -1; if ((gameData.app.nGameMode & GM_ENTROPY) && ((segP->m_owner < 0) || (segP->m_owner == GetTeam (gameData.multiplayer.nLocalPlayer) + 1))) { StopConquerWarning (); } } else if (gameStates.entropy.nTimeLastMoved < 0) gameStates.entropy.nTimeLastMoved = 0; shields = segP->Damage (playerP->shields + 1); if (shields > 0) { playerP->shields -= shields; MultiSendShields (); if (playerP->shields < 0) StartPlayerDeathSequence (this); else segP->ConquerCheck (); } else { StopConquerWarning (); fuel = segP->Refuel (INITIAL_ENERGY - playerP->energy); if (fuel > 0) playerP->energy += fuel; shields = segP->Repair (INITIAL_SHIELDS - playerP->shields); if (shields > 0) { playerP->shields += shields; MultiSendShields (); } if (!segP->m_owner) segP->ConquerCheck (); } }}
开发者ID:paud,项目名称:d2x-xl,代码行数:45,
示例3: IMPLEMENT_RMI//------------------------------------------------------------------------IMPLEMENT_RMI(CGameRules, ClSetTeam){ if (!params.entityId) // ignore these for now return true; int oldTeam = GetTeam(params.entityId); if (oldTeam==params.teamId) return true; TEntityTeamIdMap::iterator it=m_entityteams.find(params.entityId); if (it!=m_entityteams.end()) m_entityteams.erase(it); IActor *pActor=m_pActorSystem->GetActor(params.entityId); bool isplayer=pActor!=0; if (isplayer && oldTeam) { TPlayerTeamIdMap::iterator pit=m_playerteams.find(oldTeam); assert(pit!=m_playerteams.end()); stl::find_and_erase(pit->second, params.entityId); } if (params.teamId) { m_entityteams.insert(TEntityTeamIdMap::value_type(params.entityId, params.teamId)); if (isplayer) { TPlayerTeamIdMap::iterator pit=m_playerteams.find(params.teamId); assert(pit!=m_playerteams.end()); pit->second.push_back(params.entityId); } } if(isplayer) { ReconfigureVoiceGroups(params.entityId,oldTeam,params.teamId); if (pActor->IsClient()) m_pRadio->SetTeam(GetTeamName(params.teamId)); } m_pScript->CallMethod( "OnSetTeam", params.entityId, params.teamId); return true;}
开发者ID:nhnam,项目名称:Seasons,代码行数:46,
示例4: PrepareMovevoid PulseLaser::PrepareMove(){ m_front += m_speed; if (m_frame.CheckCollision(m_front, m_back, GetTeam(), GetOwner())) { m_frame.RemoveProjectile(this); } m_back += m_speed; Size screenSize = DrawWrapper::GetSize(); if (m_back.x > screenSize.x || m_back.x < 0 || m_back.y > screenSize.y || m_back.y < 0) { m_frame.RemoveProjectile(this); }}
开发者ID:shinarit,项目名称:wiz,代码行数:18,
示例5: GameWarning//------------------------------------------------------------------------void CGameRules::StoreMigratingPlayer(IActor *pActor){ if (pActor == NULL) { GameWarning("Invalid data for migrating player"); return; } IEntity *pEntity = pActor->GetEntity(); EntityId id = pEntity->GetId(); bool registered = false; uint16 channelId = pActor->GetChannelId(); CRY_ASSERT(channelId); bool bShouldAdd = true; if (bShouldAdd && (!m_hostMigrationCachedEntities.empty())) { if (!stl::find(m_hostMigrationCachedEntities, pActor->GetEntityId())) { bShouldAdd = false; } } if (bShouldAdd) { for (uint32 index = 0; index < m_migratingPlayerMaxCount; ++index) { if (!m_pMigratingPlayerInfo[index].InUse()) { m_pMigratingPlayerInfo[index].SetData(pEntity->GetName(), id, GetTeam(id), pEntity->GetWorldPos(), pEntity->GetWorldAngles(), pActor->GetHealth()); m_pMigratingPlayerInfo[index].SetChannelID(channelId); registered = true; break; } } } pEntity->Hide(true); // Hide the player, they will be unhidden when they rejoin if (!registered && bShouldAdd) { GameWarning("Too many migrating players!"); }}
开发者ID:richmondx,项目名称:bare-minimum-cryengine3,代码行数:45,
示例6: Warningbool CHL2MP_Player::HandleCommand_JoinTeam( int team ){ if ( !GetGlobalTeam( team ) || team == 0 ) { Warning( "HandleCommand_JoinTeam( %d ) - invalid team index./n", team ); return false; } if ( team == TEAM_SPECTATOR ) { // Prevent this is the cvar is set if ( !mp_allowspectators.GetInt() ) { ClientPrint( this, HUD_PRINTCENTER, "#Cannot_Be_Spectator" ); return false; } if ( /*GetTeamNumber() != TEAM_UNASSIGNED &&*/ !IsDead() ) //DHL - Skillet - Players in deathmatch are unassigned { m_fNextSuicideTime = gpGlobals->curtime; // allow the suicide to work CommitSuicide(); // add 1 to frags to balance out the 1 subtracted for killing yourself IncrementFragCount( 1 ); GetTeam()->AddScore( 1 ); //DHL - Skillet - Required to keep the scoreboard headers from getting out of sync } ChangeTeam( TEAM_SPECTATOR ); return true; } else { StopObserverMode(); State_Transition(STATE_ACTIVE); } // Switch their actual team... ChangeTeam( team ); return true;}
开发者ID:dreckard,项目名称:dhl2,代码行数:43,
示例7: whilebool Monster::Shot(Game_Manager* gm_, coord_def c, float focus_, int item_num){ if(GetShotStop()) return false; if(GetStop()) return false; if(!GetDelay() && weapon) { focus_ += weapon->GetFocusBase()+GetFocusSum(); while(SetDelay(weapon->Shot(gm_, this, GetTeam(), GetPos(), c, focus_)*panalty) < 0) { SetDelay(0.0f); weapon->Reload(); // C++ GetTeamIndex函数代码示例 C++ GetTargetUnit函数代码示例
|