Bazaar developer reference

CvUnit::IsLargerCivThan(const CvUnit *) const

Defined in
CvUnit.cpp, line 25424
Class
CvUnit
Hook name
CivHooks::CvUnit_IsLargerCivThan

Hooks

static bool BeforeCvUnit_IsLargerCivThan(const CvUnit* self, const CvUnit* pOtherUnit, bool& result);static void AfterCvUnit_IsLargerCivThan(const CvUnit* self, const CvUnit* pOtherUnit, bool& result);static bool ReplaceCvUnit_IsLargerCivThan(bool (*original)(const CvUnit*, const CvUnit*), const CvUnit* self, const CvUnit* pOtherUnit);CivRegisterBefore<CivHooks::CvUnit_IsLargerCivThan>(host, &BeforeCvUnit_IsLargerCivThan);CivRegisterAfter<CivHooks::CvUnit_IsLargerCivThan>(host, &AfterCvUnit_IsLargerCivThan);CivRegisterReplace<CivHooks::CvUnit_IsLargerCivThan>(host, &ReplaceCvUnit_IsLargerCivThan);

Code

25424bool CvUnit::IsLargerCivThan(const CvUnit* pOtherUnit) const25425{25426	int iMyCities = 0;25427	int iOtherCities = 0;2542825429	CvPlayer& kPlayer = GET_PLAYER(getOwner());25430	iMyCities = kPlayer.getNumCities();2543125432	CvPlayer& kOtherPlayer = GET_PLAYER(pOtherUnit->getOwner());25433	iOtherCities = kOtherPlayer.getNumCities();2543425435	return iMyCities > iOtherCities;25436}

Calls

Called by