Bazaar developer reference

CvLeagueAI::ScoreVoteChoice(CvRepealProposal *, int)

Defined in
CvVotingClasses.cpp, line 8868
Class
CvLeagueAI
Hook name
CivHooks::CvLeagueAI_ScoreVoteChoice_with_CvRepealProposal_int

Hooks

static bool BeforeCvLeagueAI_ScoreVoteChoice_with_CvRepealProposal_int(CvLeagueAI* self, CvRepealProposal* pProposal, int iChoice, int& result);static void AfterCvLeagueAI_ScoreVoteChoice_with_CvRepealProposal_int(CvLeagueAI* self, CvRepealProposal* pProposal, int iChoice, int& result);static int ReplaceCvLeagueAI_ScoreVoteChoice_with_CvRepealProposal_int(int (*original)(CvLeagueAI*, CvRepealProposal*, int), CvLeagueAI* self, CvRepealProposal* pProposal, int iChoice);CivRegisterBefore<CivHooks::CvLeagueAI_ScoreVoteChoice_with_CvRepealProposal_int>(host, &BeforeCvLeagueAI_ScoreVoteChoice_with_CvRepealProposal_int);CivRegisterAfter<CivHooks::CvLeagueAI_ScoreVoteChoice_with_CvRepealProposal_int>(host, &AfterCvLeagueAI_ScoreVoteChoice_with_CvRepealProposal_int);CivRegisterReplace<CivHooks::CvLeagueAI_ScoreVoteChoice_with_CvRepealProposal_int>(host, &ReplaceCvLeagueAI_ScoreVoteChoice_with_CvRepealProposal_int);

Code

8867// Score a particular choice on a particular proposal8868int CvLeagueAI::ScoreVoteChoice(CvRepealProposal* pProposal, int iChoice)8869{8870	CvAssert(pProposal != NULL);8871	if (!(pProposal != NULL)) return 0;8872	CvAssert(GC.getGame().GetGameLeagues()->GetNumActiveLeagues() > 0);8873	if (!(GC.getGame().GetGameLeagues()->GetNumActiveLeagues() > 0)) return 0;8874	CvLeague* pLeague = GC.getGame().GetGameLeagues()->GetActiveLeague();8875	CvAssert(pLeague != NULL);8876	if (!(pLeague != NULL)) return 0;88778878	int iScore = 0;88798880	switch (pProposal->GetRepealDecision()->GetType())8881	{8882	case RESOLUTION_DECISION_REPEAL:8883		{8884			iScore = ScoreVoteChoiceYesNo(pProposal, iChoice, /*bEnact*/ false);8885			break;8886		}8887	default:8888		{8889			CvAssertMsg(false, "Unexpected decision type when evaluating choices for AI on a proposed resolution.");8890			break;8891		}8892	}88938894	return iScore;8895}

Calls

Called by