Bazaar developer reference

CvGame::AnyoneHasUnit(UnitTypes) const

Defined in
CvGame.cpp, line 12246
Class
CvGame
Hook name
CivHooks::CvGame_AnyoneHasUnit

Hooks

static bool BeforeCvGame_AnyoneHasUnit(const CvGame* self, UnitTypes iUnitType, bool& result);static void AfterCvGame_AnyoneHasUnit(const CvGame* self, UnitTypes iUnitType, bool& result);static bool ReplaceCvGame_AnyoneHasUnit(bool (*original)(const CvGame*, UnitTypes), const CvGame* self, UnitTypes iUnitType);CivRegisterBefore<CivHooks::CvGame_AnyoneHasUnit>(host, &BeforeCvGame_AnyoneHasUnit);CivRegisterAfter<CivHooks::CvGame_AnyoneHasUnit>(host, &AfterCvGame_AnyoneHasUnit);CivRegisterReplace<CivHooks::CvGame_AnyoneHasUnit>(host, &ReplaceCvGame_AnyoneHasUnit);

Code

12246bool CvGame::AnyoneHasUnit(UnitTypes iUnitType) const12247{12248	for (int i = 0; i < MAX_PLAYERS; ++i) {12249		CvPlayer& player = GET_PLAYER(static_cast<PlayerTypes>(i));1225012251		if(player.isAlive() && player.HasUnit(iUnitType)) {12252			return true;12253		}12254	}1225512256	return false;12257}

Calls

Called by