Bazaar developer reference

CvGameLeagues::DoLeagueProjectContribution(PlayerTypes, LeagueProjectTypes, int)

Defined in
CvVotingClasses.cpp, line 7144
Class
CvGameLeagues
Hook name
CivHooks::CvGameLeagues_DoLeagueProjectContribution

Hooks

static bool BeforeCvGameLeagues_DoLeagueProjectContribution(CvGameLeagues* self, PlayerTypes ePlayer, LeagueProjectTypes eLeagueProject, int iValue);static void AfterCvGameLeagues_DoLeagueProjectContribution(CvGameLeagues* self, PlayerTypes ePlayer, LeagueProjectTypes eLeagueProject, int iValue);static void ReplaceCvGameLeagues_DoLeagueProjectContribution(void (*original)(CvGameLeagues*, PlayerTypes, LeagueProjectTypes, int), CvGameLeagues* self, PlayerTypes ePlayer, LeagueProjectTypes eLeagueProject, int iValue);CivRegisterBefore<CivHooks::CvGameLeagues_DoLeagueProjectContribution>(host, &BeforeCvGameLeagues_DoLeagueProjectContribution);CivRegisterAfter<CivHooks::CvGameLeagues_DoLeagueProjectContribution>(host, &AfterCvGameLeagues_DoLeagueProjectContribution);CivRegisterReplace<CivHooks::CvGameLeagues_DoLeagueProjectContribution>(host, &ReplaceCvGameLeagues_DoLeagueProjectContribution);

Code

7144void CvGameLeagues::DoLeagueProjectContribution(PlayerTypes ePlayer, LeagueProjectTypes eLeagueProject, int iValue)7145{7146	int iMatches = 0;7147	for (LeagueList::iterator it = m_vActiveLeagues.begin(); it != m_vActiveLeagues.end(); it++)7148	{7149		if (it->CanMemberContribute(ePlayer, eLeagueProject))7150		{7151			iMatches++;7152			it->ChangeMemberContribution(ePlayer, eLeagueProject, iValue);7153		}7154	}7155	CvAssertMsg(iMatches == 1, "Unexpected case when contributing to a League Project. Please send Anton your save file and version.");7156}

Calls

Called by