CvGame::DoGameStarted()
- Defined in
- CvGame.cpp, line 901
- Class
- CvGame
- Hook name
CivHooks::CvGame_DoGameStarted
Hooks
static bool BeforeCvGame_DoGameStarted(CvGame* self);static void AfterCvGame_DoGameStarted(CvGame* self);static void ReplaceCvGame_DoGameStarted(void (*original)(CvGame*), CvGame* self);CivRegisterBefore<CivHooks::CvGame_DoGameStarted>(host, &BeforeCvGame_DoGameStarted);CivRegisterAfter<CivHooks::CvGame_DoGameStarted>(host, &AfterCvGame_DoGameStarted);CivRegisterReplace<CivHooks::CvGame_DoGameStarted>(host, &ReplaceCvGame_DoGameStarted);
Code
901void CvGame::DoGameStarted()902{903 // Are features clearable?904 BuildTypes eBuild;905 int iBuildLoop;906907 bool bTempClearable;908909 FeatureTypes eFeature;910 for(int iFeatureLoop = 0; iFeatureLoop < GC.getNumFeatureInfos(); iFeatureLoop++)911 {912 eFeature = (FeatureTypes) iFeatureLoop;913914 bTempClearable = false;915916 // Check unit build actions to see if any of them clear this feature917 for(iBuildLoop = 0; iBuildLoop < GC.getNumBuildInfos(); iBuildLoop++)918 {919 eBuild = (BuildTypes) iBuildLoop;920 CvBuildInfo* pBuildInfo = GC.getBuildInfo(eBuild);921922 // Feature can be removed by this build923 if(NULL != pBuildInfo && pBuildInfo->isFeatureRemove(eFeature))924 {925 GC.getFeatureInfo(eFeature)->SetClearable(true);926927 bTempClearable = true;928 break;929 }930931 if(bTempClearable)932 break;933 }934 }935936 GET_PLAYER(getActivePlayer()).GetUnitCycler().Rebuild();937}
Calls
- CvBuildInfo::isFeatureRemove(int) const
- CvFeatureInfo::SetClearable(bool)
- CvGame::getActivePlayer() const
- CvGlobals::getBuildInfo(BuildTypes)
- CvGlobals::getFeatureInfo(FeatureTypes)
- CvGlobals::getNumBuildInfos()
- CvGlobals::getNumFeatureInfos()
- CvPlayer::GetUnitCycler()
- CvPlayerAI::getPlayer(PlayerTypes)
- CvUnitCycler::Rebuild(CvUnit *)