CvHomelandAI::ExecuteGoldenAgeMove(CvUnit *)
- Defined in
- CvHomelandAI.cpp, line 6171
- Class
- CvHomelandAI
- Hook name
CivHooks::CvHomelandAI_ExecuteGoldenAgeMove
Hooks
static bool BeforeCvHomelandAI_ExecuteGoldenAgeMove(CvHomelandAI* self, CvUnit* pUnit, bool& result);static void AfterCvHomelandAI_ExecuteGoldenAgeMove(CvHomelandAI* self, CvUnit* pUnit, bool& result);static bool ReplaceCvHomelandAI_ExecuteGoldenAgeMove(bool (*original)(CvHomelandAI*, CvUnit*), CvHomelandAI* self, CvUnit* pUnit);CivRegisterBefore<CivHooks::CvHomelandAI_ExecuteGoldenAgeMove>(host, &BeforeCvHomelandAI_ExecuteGoldenAgeMove);CivRegisterAfter<CivHooks::CvHomelandAI_ExecuteGoldenAgeMove>(host, &AfterCvHomelandAI_ExecuteGoldenAgeMove);CivRegisterReplace<CivHooks::CvHomelandAI_ExecuteGoldenAgeMove>(host, &ReplaceCvHomelandAI_ExecuteGoldenAgeMove);
Code
6171bool CvHomelandAI::ExecuteGoldenAgeMove(CvUnit* pUnit)6172{6173 if (pUnit->canGoldenAge(pUnit->plot()))6174 {6175 pUnit->PushMission(CvTypes::getMISSION_GOLDEN_AGE());6176 UnitProcessed(pUnit->GetID());61776178 if(GC.getLogging() && GC.getAILogging())6179 {6180 CvString strLogString;6181 CvString strTemp;6182 strTemp = pUnit->getUnitInfo().GetDescription();6183 strLogString.Format("%s started golden age with unit at, X: %d, Y: %d", strTemp.GetCString(), pUnit->getX(), pUnit->getY());6184 LogHomelandMessage(strLogString);6185 }6186 }6187 else6188 {6189 MoveCivilianToSafety(pUnit);6190 }61916192 return true;6193}
Calls
- CvBaseInfo::GetDescription() const
- CvGlobals::getAILogging()
- CvGlobals::getLogging()
- CvHomelandAI::LogHomelandMessage(CvString &)
- CvHomelandAI::MoveCivilianToSafety(CvUnit *, bool, bool)
- CvHomelandAI::UnitProcessed(int)
CvString::CvStringCvString::FormatCvString::GetCStringCvString::operator=- CvTypes::getMISSION_GOLDEN_AGE()
- CvUnit::canGoldenAge(const CvPlot *, bool) const
- CvUnit::GetID() const
- CvUnit::getUnitInfo() const
- CvUnit::getX() const
- CvUnit::getY() const
- CvUnit::plot() const
- CvUnit::PushMission(MissionTypes, int, int, int, bool, bool, MissionAITypes, CvPlot *, CvUnit *)