Bazaar developer reference

CvPlayer::unitsGoldenAgeReady() const

Defined in
CvPlayer.cpp, line 9944
Class
CvPlayer
Hook name
CivHooks::CvPlayer_unitsGoldenAgeReady

Hooks

static bool BeforeCvPlayer_unitsGoldenAgeReady(const CvPlayer* self, int& result);static void AfterCvPlayer_unitsGoldenAgeReady(const CvPlayer* self, int& result);static int ReplaceCvPlayer_unitsGoldenAgeReady(int (*original)(const CvPlayer*), const CvPlayer* self);CivRegisterBefore<CivHooks::CvPlayer_unitsGoldenAgeReady>(host, &BeforeCvPlayer_unitsGoldenAgeReady);CivRegisterAfter<CivHooks::CvPlayer_unitsGoldenAgeReady>(host, &AfterCvPlayer_unitsGoldenAgeReady);CivRegisterReplace<CivHooks::CvPlayer_unitsGoldenAgeReady>(host, &ReplaceCvPlayer_unitsGoldenAgeReady);

Code

9944int CvPlayer::unitsGoldenAgeReady() const9945{9946	const CvUnit* pLoopUnit;9947	bool* pabUnitUsed;9948	int iCount;9949	int iLoop;9950	int iI;99519952	pabUnitUsed = FNEW(bool[GC.getNumUnitInfos()], c_eCiv5GameplayDLL, 0);99539954	for(iI = 0; iI < GC.getNumUnitInfos(); iI++)9955	{9956		pabUnitUsed[iI] = false;9957	}99589959	iCount = 0;99609961	for(pLoopUnit = firstUnit(&iLoop); pLoopUnit != NULL; pLoopUnit = nextUnit(&iLoop))9962	{9963		if(!(pabUnitUsed[pLoopUnit->getUnitType()]))9964		{9965			if(pLoopUnit->isGoldenAge())9966			{9967				pabUnitUsed[pLoopUnit->getUnitType()] = true;9968				iCount++;9969			}9970		}9971	}99729973	SAFE_DELETE_ARRAY(pabUnitUsed);99749975	return iCount;9976}

Calls

Called by