CvPlayer::GetNumPlots() const
- Defined in
- CvPlayer.cpp, line 26407
- Class
- CvPlayer
- Hook name
CivHooks::CvPlayer_GetNumPlots
Hooks
static bool BeforeCvPlayer_GetNumPlots(const CvPlayer* self, int& result);static void AfterCvPlayer_GetNumPlots(const CvPlayer* self, int& result);static int ReplaceCvPlayer_GetNumPlots(int (*original)(const CvPlayer*), const CvPlayer* self);CivRegisterBefore<CivHooks::CvPlayer_GetNumPlots>(host, &BeforeCvPlayer_GetNumPlots);CivRegisterAfter<CivHooks::CvPlayer_GetNumPlots>(host, &AfterCvPlayer_GetNumPlots);CivRegisterReplace<CivHooks::CvPlayer_GetNumPlots>(host, &ReplaceCvPlayer_GetNumPlots);
Code
26406/// How many plots does this player own?26407int CvPlayer::GetNumPlots() const26408{26409 int iNumPlots = 0;2641026411 CvPlot* pLoopPlot;26412 int iNumPlotsInEntireWorld = GC.getMap().numPlots();26413 for(int iI = 0; iI < iNumPlotsInEntireWorld; iI++)26414 {26415 pLoopPlot = GC.getMap().plotByIndexUnchecked(iI);2641626417 if(pLoopPlot->getOwner() != m_eID)26418 continue;2641926420 iNumPlots++;26421 }2642226423 return iNumPlots;26424}
Calls
- CvGlobals::getMap()
- CvMap::numPlots() const
- CvMap::plotByIndexUnchecked(int) const
- CvPlot::getOwner() const
FAutoVariable::operator const PlayerTypes &