CvTeam::getLeaderID() const
- Defined in
- CvTeam.cpp, line 2622
- Class
- CvTeam
- Hook name
CivHooks::CvTeam_getLeaderID
Hooks
static bool BeforeCvTeam_getLeaderID(const CvTeam* self, PlayerTypes& result);static void AfterCvTeam_getLeaderID(const CvTeam* self, PlayerTypes& result);static PlayerTypes ReplaceCvTeam_getLeaderID(PlayerTypes (*original)(const CvTeam*), const CvTeam* self);CivRegisterBefore<CivHooks::CvTeam_getLeaderID>(host, &BeforeCvTeam_getLeaderID);CivRegisterAfter<CivHooks::CvTeam_getLeaderID>(host, &AfterCvTeam_getLeaderID);CivRegisterReplace<CivHooks::CvTeam_getLeaderID>(host, &ReplaceCvTeam_getLeaderID);
Code
2622PlayerTypes CvTeam::getLeaderID() const2623{2624 int iI;26252626 for(iI = 0; iI < MAX_PLAYERS; iI++)2627 {2628 CvPlayerAI& thisPlayer = GET_PLAYER((PlayerTypes)iI);2629 if(thisPlayer.isAlive())2630 {2631 if(thisPlayer.getTeam() == m_eID)2632 {2633 return ((PlayerTypes)iI);2634 }2635 }2636 }26372638 for(iI = 0; iI < MAX_PLAYERS; iI++)2639 {2640 CvPlayerAI& thisPlayer = GET_PLAYER((PlayerTypes)iI);2641 if(thisPlayer.getTeam() == m_eID)2642 {2643 return ((PlayerTypes)iI);2644 }2645 }26462647 return NO_PLAYER;2648}
Calls
Called by
37 functions in 10 files
- CvDeal::IsPossibleToTradeItem(PlayerTypes, PlayerTypes, TradeableItems, int, int, int, bool, bool, bool)
- CvGameDeals::DoEndTradedItem(CvTradedItem *, PlayerTypes, bool)
- CvGameDeals::FinalizeDealNotify(PlayerTypes, PlayerTypes, CvWeightedVector<TeamTypes, ((63)), true> &)
- CvDllTeam::GetLeaderID() const
- CvGame::DoPlaceTeamInVictoryCompetition(VictoryTypes, TeamTypes)
- CvGame::DoResearchAgreementNotification(TeamTypes, TeamTypes)
- CvGame::initDiplomacy()
- CvGame::setWinner(TeamTypes, VictoryTypes)
- CvGame::updateWar()
- CvMinorCivAI::DoFirstContactWithMajor(TeamTypes, bool)
- CvMinorCivAI::DoTestProxyWarAnnouncement()
- CvMinorCivAI::DoTestProxyWarAnnouncementOnFirstContact(PlayerTypes)
- CvMinorCivAI::IsProxyWarActiveForMajor(PlayerTypes, PlayerTypes)
- CvPlayer::SetHasLostCapital(bool, PlayerTypes)
- CvPlot::IsFriendlyTerritory(PlayerTypes) const
- CvTeam::DoBarbarianTech()
- CvTeam::DoDeclareWar(PlayerTypes, bool, TeamTypes, bool, bool)
- CvTeam::DoMakePeace(PlayerTypes, bool, TeamTypes, bool, bool)
- CvTeam::DoMinorCivTech()
- CvTeam::GetTeamVotingForInDiplo() const
- CvTeam::SetCurrentEra(EraTypes)
- CvTeam::SetHasDefensivePact(TeamTypes, bool)
- CvTeam::SetHasResearchAgreement(TeamTypes, bool)
- CvTeam::SetHasTradeAgreement(TeamTypes, bool)
- CvTeam::addTeam(TeamTypes)
- CvTeam::changeProjectCount(ProjectTypes, int)
- CvTeam::countEnemyDangerByArea(CvArea *) const
- CvTeam::getSecretaryID() const
- CvTeam::makeHasMet(TeamTypes, bool)
- CvTeam::processBuilding(BuildingTypes, int, bool)
- CvTeam::resetVictoryProgress()
- CvTeam::setHasTech(TechTypes, bool, PlayerTypes, bool, bool)
- CvTeam::shareCounters(TeamTypes)
- CvTeam::testCircumnavigated()
- CvUnit::canEnterTerritory(TeamTypes, bool, bool, bool) const
- CvLeagueAI::EvaluateAlignment(PlayerTypes)
- CvLuaTeam::lGetLeaderID(lua_State *)