Bazaar developer reference

CvDiplomacyAI::CacheOtherPlayerWarValuesLost()

Defined in
CvDiplomacyAI.cpp, line 9330
Class
CvDiplomacyAI
Hook name
CivHooks::CvDiplomacyAI_CacheOtherPlayerWarValuesLost

Hooks

static bool BeforeCvDiplomacyAI_CacheOtherPlayerWarValuesLost(CvDiplomacyAI* self);static void AfterCvDiplomacyAI_CacheOtherPlayerWarValuesLost(CvDiplomacyAI* self);static void ReplaceCvDiplomacyAI_CacheOtherPlayerWarValuesLost(void (*original)(CvDiplomacyAI*), CvDiplomacyAI* self);CivRegisterBefore<CivHooks::CvDiplomacyAI_CacheOtherPlayerWarValuesLost>(host, &BeforeCvDiplomacyAI_CacheOtherPlayerWarValuesLost);CivRegisterAfter<CivHooks::CvDiplomacyAI_CacheOtherPlayerWarValuesLost>(host, &AfterCvDiplomacyAI_CacheOtherPlayerWarValuesLost);CivRegisterReplace<CivHooks::CvDiplomacyAI_CacheOtherPlayerWarValuesLost>(host, &ReplaceCvDiplomacyAI_CacheOtherPlayerWarValuesLost);

Code

9329// Cache the current war value lost in a separate place, so we can track when it changes value9330void CvDiplomacyAI::CacheOtherPlayerWarValuesLost()9331{9332	for(int iPlayer = 0; iPlayer < MAX_CIV_PLAYERS; iPlayer++)9333	{9334		PlayerTypes ePlayer = (PlayerTypes) iPlayer;9335		for(int iLostToPlayer = 0; iLostToPlayer < MAX_CIV_PLAYERS; iLostToPlayer++)9336		{9337			PlayerTypes eLostToPlayer = (PlayerTypes) iLostToPlayer;9338			SetOtherPlayerLastRoundWarValueLost(ePlayer, eLostToPlayer, GetOtherPlayerWarValueLost(ePlayer, eLostToPlayer));9339		}9340	}9341}

Calls

Called by