Bazaar developer reference

CvLeague::DoVoteRepeal(int, PlayerTypes, int, int)

Defined in
CvVotingClasses.cpp, line 2244
Class
CvLeague
Hook name
CivHooks::CvLeague_DoVoteRepeal

Hooks

static bool BeforeCvLeague_DoVoteRepeal(CvLeague* self, int iResolutionID, PlayerTypes eVoter, int iNumVotes, int iChoice);static void AfterCvLeague_DoVoteRepeal(CvLeague* self, int iResolutionID, PlayerTypes eVoter, int iNumVotes, int iChoice);static void ReplaceCvLeague_DoVoteRepeal(void (*original)(CvLeague*, int, PlayerTypes, int, int), CvLeague* self, int iResolutionID, PlayerTypes eVoter, int iNumVotes, int iChoice);CivRegisterBefore<CivHooks::CvLeague_DoVoteRepeal>(host, &BeforeCvLeague_DoVoteRepeal);CivRegisterAfter<CivHooks::CvLeague_DoVoteRepeal>(host, &AfterCvLeague_DoVoteRepeal);CivRegisterReplace<CivHooks::CvLeague_DoVoteRepeal>(host, &ReplaceCvLeague_DoVoteRepeal);

Code

2244void CvLeague::DoVoteRepeal(int iResolutionID, PlayerTypes eVoter, int iNumVotes, int iChoice)2245{2246	bool bProcessed = false;2247	if (CanVote(eVoter) && GetRemainingVotesForMember(eVoter) >= iNumVotes)2248	{2249		if (IsRepealProposed(iResolutionID))2250		{2251			for (RepealProposalList::iterator it = m_vRepealProposals.begin(); it != m_vRepealProposals.end(); it++)2252			{2253				if (it->GetTargetResolutionID() == iResolutionID)2254				{2255					it->GetRepealDecision()->ProcessVote(eVoter, iNumVotes, iChoice);2256					GetMember(eVoter)->iVotes -= iNumVotes;2257					CvAssertMsg(GetRemainingVotesForMember(eVoter) >= 0, "A voter now has negative votes remaining. Please send Anton your save file and version.");2258					bProcessed = true;2259					break;2260				}2261			}2262		}2263	}2264	CvAssertMsg(bProcessed, "Attempt to vote on a repeal resolution when not allowed to. Please send Anton your save file and version.");2265	GC.GetEngineUserInterface()->setDirty(LeagueScreen_DIRTY_BIT, true);2266}

Calls

Called by