CvArmyAI::AreAllInWater()
- Defined in
- CvArmyAI.cpp, line 590
- Class
- CvArmyAI
- Hook name
CivHooks::CvArmyAI_AreAllInWater
Hooks
static bool BeforeCvArmyAI_AreAllInWater(CvArmyAI* self, bool& result);static void AfterCvArmyAI_AreAllInWater(CvArmyAI* self, bool& result);static bool ReplaceCvArmyAI_AreAllInWater(bool (*original)(CvArmyAI*), CvArmyAI* self);CivRegisterBefore<CivHooks::CvArmyAI_AreAllInWater>(host, &BeforeCvArmyAI_AreAllInWater);CivRegisterAfter<CivHooks::CvArmyAI_AreAllInWater>(host, &AfterCvArmyAI_AreAllInWater);CivRegisterReplace<CivHooks::CvArmyAI_AreAllInWater>(host, &ReplaceCvArmyAI_AreAllInWater);
Code
589/// Everyone in the water now?590bool CvArmyAI::AreAllInWater()591{592 UnitHandle pUnit;593594 pUnit = GetFirstUnit();595 while(pUnit)596 {597 if(!pUnit->plot()->isWater())598 {599 return false;600 }601 pUnit = GetNextUnit();602 }603604 return true;605}
Calls
- CvArmyAI::GetFirstUnit()
- CvArmyAI::GetNextUnit()
- CvPlot::isWater() const
- CvUnit::plot() const
FObjectHandle::FObjectHandleFObjectHandle::operator boolFObjectHandle::operator->FObjectHandle::operator=