atWar(TeamTypes, TeamTypes)
- Defined in
- CvGameCoreUtils.cpp, line 157
- Hook name
CivHooks::atWar
Hooks
static bool BeforeatWar(TeamTypes eTeamA, TeamTypes eTeamB, bool& result);static void AfteratWar(TeamTypes eTeamA, TeamTypes eTeamB, bool& result);static bool ReplaceatWar(bool (*original)(TeamTypes, TeamTypes), TeamTypes eTeamA, TeamTypes eTeamB);CivRegisterBefore<CivHooks::atWar>(host, &BeforeatWar);CivRegisterAfter<CivHooks::atWar>(host, &AfteratWar);CivRegisterReplace<CivHooks::atWar>(host, &ReplaceatWar);
Code
157bool atWar(TeamTypes eTeamA, TeamTypes eTeamB)158{159 if((eTeamA == NO_TEAM) || (eTeamB == NO_TEAM))160 {161 return false;162 }163164 CvAssert(GET_TEAM(eTeamA).isAtWar(eTeamB) == GET_TEAM(eTeamB).isAtWar(eTeamA));165 CvAssert((eTeamA != eTeamB) || !(GET_TEAM(eTeamA).isAtWar(eTeamB)));166167 return GET_TEAM(eTeamA).isAtWar(eTeamB);168}
Calls
Called by
32 functions in 14 files
- CvAIOperationNavalSuperiority::FindBestTarget()
- CvArea::getEnemyUnits(PlayerTypes) const
- IgnoreUnitsValid(CvAStarNode *, CvAStarNode *, int, const void *, CvAStar *)
- PathValid(CvAStarNode *, CvAStarNode *, int, const void *, CvAStar *)
- StepValid(CvAStarNode *, CvAStarNode *, int, const void *, CvAStar *)
- StepValidAnyArea(CvAStarNode *, CvAStarNode *, int, const void *, CvAStar *)
- TacticalAnalysisMapPathValid(CvAStarNode *, CvAStarNode *, int, const void *, CvAStar *)
- CvDangerPlots::ShouldIgnoreCitadel(CvPlot *, bool)
- CvGame::updateWar()
- PUF_isEnemy(const CvUnit *, int, int)
- CvHomelandAI::FindHomelandTargets()
- CvMap::findCity(int, int, PlayerTypes, TeamTypes, bool, bool, TeamTypes, DirectionTypes, const CvCity *)
- CvMilitaryAI::GetBestAirSweepTarget(CvUnit *) const
- CvMilitaryAI::GetMaxPossibleInterceptions(CvPlot *, bool) const
- CvMilitaryAI::GetNumEnemyAirUnitsInRange(CvPlot *, int, bool, bool) const
- CvPlot::canBuild(BuildTypes, PlayerTypes, bool, bool) const
- CvPlot::verifyUnitValidPlot()
- isEnemy(const CvUnit *, TeamTypes, bool)
- CvPlayerReligions::GetNumForeignFollowers(bool) const
- CvReligionAI::ScoreCityForMissionary(CvCity *, UnitHandle)
- CvTacticalAI::FindTacticalTargets()
- CvTacticalAI::NearVisibleEnemy(UnitHandle, int)
- CvTacticalAnalysisMap::MarkCellsNearEnemy()
- CvUnit::CanDistanceGift(PlayerTypes) const
- CvUnit::EnemyScoreAtRange(const CvPlot *, bool) const
- CvUnit::GetGenericMaxStrengthModifier(const CvUnit *, const CvPlot *, bool) const
- CvUnit::GetMaxRangedCombatStrength(const CvUnit *, const CvCity *, bool, bool) const
- CvUnit::IsUnderEnemyRangedAttack() const
- CvUnit::canGift(bool, bool) const
- CvUnit::canPillage(const CvPlot *) const
- CvUnit::canRangeStrikeAt(int, int, bool, bool) const
- CvUnit::isEnemy(TeamTypes, const CvPlot *) const