CvUnit::isEnemy(TeamTypes, const CvPlot *) const
- Defined in
- CvUnit.cpp, line 22071
- Class
- CvUnit
- Hook name
CivHooks::CvUnit_isEnemy
Hooks
static bool BeforeCvUnit_isEnemy(const CvUnit* self, TeamTypes eTeam, const CvPlot* pPlot, bool& result);static void AfterCvUnit_isEnemy(const CvUnit* self, TeamTypes eTeam, const CvPlot* pPlot, bool& result);static bool ReplaceCvUnit_isEnemy(bool (*original)(const CvUnit*, TeamTypes, const CvPlot*), const CvUnit* self, TeamTypes eTeam, const CvPlot* pPlot);CivRegisterBefore<CivHooks::CvUnit_isEnemy>(host, &BeforeCvUnit_isEnemy);CivRegisterAfter<CivHooks::CvUnit_isEnemy>(host, &AfterCvUnit_isEnemy);CivRegisterReplace<CivHooks::CvUnit_isEnemy>(host, &ReplaceCvUnit_isEnemy);
Code
22071bool CvUnit::isEnemy(TeamTypes eTeam, const CvPlot* pPlot) const22072{22073 VALIDATE_OBJECT22074 if(NULL == pPlot)22075 {22076 pPlot = plot();22077 }2207822079 if(! pPlot)22080 {22081 return false;22082 }22083 return (atWar(GET_PLAYER(getCombatOwner(eTeam, *pPlot)).getTeam(), eTeam));22084}
Calls
Called by
- CvAIOperationNavalSuperiority::FindBestTarget()
- CvPlayer::canSpyBribeUnit(PlayerTypes, CvUnit &) const
- CvPlayer::receiveGoody(CvPlot *, GoodyTypes, CvUnit *)
- CvPlot::getBestDefender(PlayerTypes, PlayerTypes, const CvUnit *, bool, bool, bool, bool) const
- CvPlot::isValidRoute(const CvUnit *) const
- CvPlot::isEnemyCity(const CvUnit &) const
- CvTacticalAnalysisMap::PopulateCell(int, CvPlot *)
- CvUnit::DoAttrition()
- CvUnit::GetBestInterceptor(const CvPlot &, CvUnit *, bool, bool) const
- CvUnit::GetInterceptorCount(const CvPlot &, CvUnit *, bool, bool) const
- CvUnit::ShowMoves() const
- CvUnit::canEnterTerritory(TeamTypes, bool, bool, bool) const
- CvUnit::canSiege(TeamTypes) const
- CvUnit::healRate(const CvPlot *) const
- CvUnit::jumpToNearestValidPlot()
- CvUnit::jumpToNearestValidPlotWithinRange(int)
- CvUnit::pillage()
- CvUnit::potentialWarAction(const CvPlot *) const
- CvUnit::setXY(int, int, bool, bool, bool, bool, bool)
- CvUnitCombat::GenerateNuclearCombatInfo(CvUnit &, CvPlot &, CvCombatInfo *)