Bazaar developer reference

CvLeague::GetVotesSpentThisSession()

Defined in
CvVotingClasses.cpp, line 2161
Class
CvLeague
Hook name
CivHooks::CvLeague_GetVotesSpentThisSession

Hooks

static bool BeforeCvLeague_GetVotesSpentThisSession(CvLeague* self, int& result);static void AfterCvLeague_GetVotesSpentThisSession(CvLeague* self, int& result);static int ReplaceCvLeague_GetVotesSpentThisSession(int (*original)(CvLeague*), CvLeague* self);CivRegisterBefore<CivHooks::CvLeague_GetVotesSpentThisSession>(host, &BeforeCvLeague_GetVotesSpentThisSession);CivRegisterAfter<CivHooks::CvLeague_GetVotesSpentThisSession>(host, &AfterCvLeague_GetVotesSpentThisSession);CivRegisterReplace<CivHooks::CvLeague_GetVotesSpentThisSession>(host, &ReplaceCvLeague_GetVotesSpentThisSession);

Code

2161int CvLeague::GetVotesSpentThisSession()2162{2163	int iVotes = 0;2164	if (IsInSession())2165	{2166		for (EnactProposalList::iterator it = m_vEnactProposals.begin(); it != m_vEnactProposals.end(); ++it)2167		{2168			iVotes += it->GetVoterDecision()->GetVotesCast();2169		}2170		for (RepealProposalList::iterator it = m_vRepealProposals.begin(); it != m_vRepealProposals.end(); ++it)2171		{2172			iVotes += it->GetRepealDecision()->GetVotesCast();2173		}2174	}2175	return iVotes;2176}

Calls

Called by