Bazaar developer reference

CvGame::AnyoneHasPolicy(PolicyTypes) const

Defined in
CvGame.cpp, line 12131
Class
CvGame
Hook name
CivHooks::CvGame_AnyoneHasPolicy

Hooks

static bool BeforeCvGame_AnyoneHasPolicy(const CvGame* self, PolicyTypes iPolicyType, bool& result);static void AfterCvGame_AnyoneHasPolicy(const CvGame* self, PolicyTypes iPolicyType, bool& result);static bool ReplaceCvGame_AnyoneHasPolicy(bool (*original)(const CvGame*, PolicyTypes), const CvGame* self, PolicyTypes iPolicyType);CivRegisterBefore<CivHooks::CvGame_AnyoneHasPolicy>(host, &BeforeCvGame_AnyoneHasPolicy);CivRegisterAfter<CivHooks::CvGame_AnyoneHasPolicy>(host, &AfterCvGame_AnyoneHasPolicy);CivRegisterReplace<CivHooks::CvGame_AnyoneHasPolicy>(host, &ReplaceCvGame_AnyoneHasPolicy);

Code

12131bool CvGame::AnyoneHasPolicy(PolicyTypes iPolicyType) const12132{12133	for (int i = 0; i < MAX_PLAYERS; ++i) {12134		CvPlayer& player = GET_PLAYER(static_cast<PlayerTypes>(i));1213512136		if(player.isAlive() && player.HasPolicy(iPolicyType)) {12137			return true;12138		}12139	}1214012141	return false;12142}

Calls

Called by