Bazaar developer reference

CvPreGame::calcActiveSlotCount(const std::vector<SlotStatus> &, const std::vector<SlotClaim> &)

Defined in
CvPreGame.cpp, line 495
Hook name
CivHooks::CvPreGame_calcActiveSlotCount

Hooks

static bool BeforeCvPreGame_calcActiveSlotCount(const std::vector<SlotStatus>& slotStatus, const std::vector<SlotClaim>& slotClaims, int& result);static void AfterCvPreGame_calcActiveSlotCount(const std::vector<SlotStatus>& slotStatus, const std::vector<SlotClaim>& slotClaims, int& result);static int ReplaceCvPreGame_calcActiveSlotCount(int (*original)(const std::vector<SlotStatus>&, const std::vector<SlotClaim>&), const std::vector<SlotStatus>& slotStatus, const std::vector<SlotClaim>& slotClaims);CivRegisterBefore<CivHooks::CvPreGame_calcActiveSlotCount>(host, &BeforeCvPreGame_calcActiveSlotCount);CivRegisterAfter<CivHooks::CvPreGame_calcActiveSlotCount>(host, &AfterCvPreGame_calcActiveSlotCount);CivRegisterReplace<CivHooks::CvPreGame_calcActiveSlotCount>(host, &ReplaceCvPreGame_calcActiveSlotCount);

Code

495int calcActiveSlotCount(const std::vector<SlotStatus>& slotStatus, const std::vector<SlotClaim>& slotClaims)496{497	int iCount = 0;498	int i = 0;499	for(i = 0; i < MAX_PLAYERS; ++i)500	{501		SlotStatus eStatus = slotStatus[i];502		SlotClaim eClaim = slotClaims[i];503504		if((eStatus == SS_TAKEN || eStatus == SS_COMPUTER || eStatus == SS_OBSERVER) 505			&& (eClaim == SLOTCLAIM_ASSIGNED || eClaim == SLOTCLAIM_RESERVED))506			++iCount;507	}508509	return iCount;510}

Calls

Called by