CvPlayer::IsAITeammateOfHuman() const
- Defined in
- CvPlayer.cpp, line 18606
- Class
- CvPlayer
- Hook name
CivHooks::CvPlayer_IsAITeammateOfHuman
Hooks
static bool BeforeCvPlayer_IsAITeammateOfHuman(const CvPlayer* self, bool& result);static void AfterCvPlayer_IsAITeammateOfHuman(const CvPlayer* self, bool& result);static bool ReplaceCvPlayer_IsAITeammateOfHuman(bool (*original)(const CvPlayer*), const CvPlayer* self);CivRegisterBefore<CivHooks::CvPlayer_IsAITeammateOfHuman>(host, &BeforeCvPlayer_IsAITeammateOfHuman);CivRegisterAfter<CivHooks::CvPlayer_IsAITeammateOfHuman>(host, &AfterCvPlayer_IsAITeammateOfHuman);CivRegisterReplace<CivHooks::CvPlayer_IsAITeammateOfHuman>(host, &ReplaceCvPlayer_IsAITeammateOfHuman);
Code
18606bool CvPlayer::IsAITeammateOfHuman() const18607{18608 bool bRtnValue = false;1860918610 for(int i = 0; i < MAX_PLAYERS; ++i)18611 {18612 CvPlayer& player = GET_PLAYER(static_cast<PlayerTypes>(i));18613 if(player.isHuman() && player.isAlive())18614 {18615 if(player.getTeam() == getTeam())18616 {18617 bRtnValue = true;18618 break;18619 }18620 }18621 }1862218623 return bRtnValue;18624}
Calls
Called by
- CvCity::GetFaithPurchaseCost(BuildingTypes)
- CvCity::GetFaithPurchaseCost(UnitTypes, bool)
- CvPlayer::GetNumUnitsSupplied() const
- CvPlayer::GetUnhappiness(CvCity *, CvCity *) const
- CvPlayer::getGrowthThreshold(int) const
- CvPlayer::getProductionNeeded(BuildingTypes) const
- CvPlayer::getProductionNeeded(ProjectTypes) const
- CvPlayer::getProductionNeeded(UnitTypes) const
- CvPlayerReligions::GetCostNextProphet(bool, bool, bool) const
- CvTreasury::CalculateUnitCost(int &, int &, int &, int &)
- CvTreasury::CalculateUnitSupply(int &, int &)
- CvTreasury::GetBuildingGoldMaintenance() const
- CvUnit::upgradePrice(UnitTypes) const
- CvUnit::workRate(bool, BuildTypes) const