Bazaar developer reference

CvPlayer::GetFirstReadyUnit() const

Defined in
CvPlayer.cpp, line 5325
Class
CvPlayer
Hook name
CivHooks::CvPlayer_GetFirstReadyUnit

Hooks

static bool BeforeCvPlayer_GetFirstReadyUnit(const CvPlayer* self, const CvUnit*& result);static void AfterCvPlayer_GetFirstReadyUnit(const CvPlayer* self, const CvUnit*& result);static const CvUnit* ReplaceCvPlayer_GetFirstReadyUnit(const CvUnit* (*original)(const CvPlayer*), const CvPlayer* self);CivRegisterBefore<CivHooks::CvPlayer_GetFirstReadyUnit>(host, &BeforeCvPlayer_GetFirstReadyUnit);CivRegisterAfter<CivHooks::CvPlayer_GetFirstReadyUnit>(host, &AfterCvPlayer_GetFirstReadyUnit);CivRegisterReplace<CivHooks::CvPlayer_GetFirstReadyUnit>(host, &ReplaceCvPlayer_GetFirstReadyUnit);

Code

5325const CvUnit* CvPlayer::GetFirstReadyUnit() const5326{5327	const CvUnit* pLoopUnit;5328	int iLoop;53295330	for(pLoopUnit = firstUnit(&iLoop); pLoopUnit; pLoopUnit = nextUnit(&iLoop))5331	{5332		if(pLoopUnit->ReadyToMove() && !pLoopUnit->isDelayedDeath())5333		{5334			return pLoopUnit;5335		}5336	}53375338	return NULL;5339}

Calls

Called by