CvPlot::isVisibleOtherUnit(PlayerTypes) const
- Defined in
- CvPlot.cpp, line 4128
- Class
- CvPlot
- Hook name
CivHooks::CvPlot_isVisibleOtherUnit
Hooks
static bool BeforeCvPlot_isVisibleOtherUnit(const CvPlot* self, PlayerTypes ePlayer, bool& result);static void AfterCvPlot_isVisibleOtherUnit(const CvPlot* self, PlayerTypes ePlayer, bool& result);static bool ReplaceCvPlot_isVisibleOtherUnit(bool (*original)(const CvPlot*, PlayerTypes), const CvPlot* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvPlot_isVisibleOtherUnit>(host, &BeforeCvPlot_isVisibleOtherUnit);CivRegisterAfter<CivHooks::CvPlot_isVisibleOtherUnit>(host, &AfterCvPlot_isVisibleOtherUnit);CivRegisterReplace<CivHooks::CvPlot_isVisibleOtherUnit>(host, &ReplaceCvPlot_isVisibleOtherUnit);
Code
4128bool CvPlot::isVisibleOtherUnit(PlayerTypes ePlayer) const4129{4130 CvAssertMsg(ePlayer != NO_PLAYER, "Source player must be valid");4131 const IDInfo* pUnitNode = m_units.head();4132 if(pUnitNode)4133 {4134 TeamTypes eTeam = GET_PLAYER(ePlayer).getTeam();41354136 do4137 {4138 const CvUnit* pLoopUnit = GetPlayerUnit(*pUnitNode);4139 pUnitNode = m_units.next(pUnitNode);41404141 if(pLoopUnit && !pLoopUnit->isInvisible(eTeam, false))4142 {4143 if(isOtherTeam(pLoopUnit, eTeam))4144 {4145 return true;4146 }4147 }4148 }4149 while(pUnitNode != NULL);4150 }41514152 return false;4153}
Calls
- CvPlayer::getTeam() const
- CvPlayerAI::getPlayer(PlayerTypes)
- CvUnit::isInvisible(TeamTypes, bool, bool) const
FFastSmallFixedList::headFFastSmallFixedList::next- GetPlayerUnit(const IDInfo &)
- isOtherTeam(const CvUnit *, TeamTypes)