CvLeagueAI::GetExtraVotesPerCityStateAlly()
- Defined in
- CvVotingClasses.cpp, line 8413
- Class
- CvLeagueAI
- Hook name
CivHooks::CvLeagueAI_GetExtraVotesPerCityStateAlly
Hooks
static bool BeforeCvLeagueAI_GetExtraVotesPerCityStateAlly(CvLeagueAI* self, int& result);static void AfterCvLeagueAI_GetExtraVotesPerCityStateAlly(CvLeagueAI* self, int& result);static int ReplaceCvLeagueAI_GetExtraVotesPerCityStateAlly(int (*original)(CvLeagueAI*), CvLeagueAI* self);CivRegisterBefore<CivHooks::CvLeagueAI_GetExtraVotesPerCityStateAlly>(host, &BeforeCvLeagueAI_GetExtraVotesPerCityStateAlly);CivRegisterAfter<CivHooks::CvLeagueAI_GetExtraVotesPerCityStateAlly>(host, &AfterCvLeagueAI_GetExtraVotesPerCityStateAlly);CivRegisterReplace<CivHooks::CvLeagueAI_GetExtraVotesPerCityStateAlly>(host, &ReplaceCvLeagueAI_GetExtraVotesPerCityStateAlly);
Code
8413int CvLeagueAI::GetExtraVotesPerCityStateAlly()8414{8415 int iVotes = 0;84168417 if (GC.getGame().GetGameLeagues()->GetNumActiveLeagues() > 0)8418 {8419 CvLeague* pLeague = GC.getGame().GetGameLeagues()->GetActiveLeague();8420 if (pLeague)8421 {8422 LeagueSpecialSessionTypes eGoverningSpecialSession = NO_LEAGUE_SPECIAL_SESSION;8423 if (pLeague->GetCurrentSpecialSession() != NO_LEAGUE_SPECIAL_SESSION)8424 {8425 eGoverningSpecialSession = pLeague->GetCurrentSpecialSession();8426 }8427 else if (pLeague->GetLastSpecialSession() != NO_LEAGUE_SPECIAL_SESSION)8428 {8429 eGoverningSpecialSession = pLeague->GetLastSpecialSession();8430 }84318432 CvAssert(eGoverningSpecialSession != NO_LEAGUE_SPECIAL_SESSION);8433 if (eGoverningSpecialSession != NO_LEAGUE_SPECIAL_SESSION)8434 {8435 CvLeagueSpecialSessionEntry* pInfo = GC.getLeagueSpecialSessionInfo(eGoverningSpecialSession);8436 CvAssert(pInfo != NULL);8437 if (pInfo != NULL) 8438 {8439 iVotes += pInfo->GetCityStateDelegates();8440 }8441 }8442 }8443 }84448445 return iVotes;8446}
Calls
- CvGame::GetGameLeagues()
- CvGameLeagues::GetActiveLeague()
- CvGameLeagues::GetNumActiveLeagues()
- CvGlobals::getGame()
- CvGlobals::getLeagueSpecialSessionInfo(LeagueSpecialSessionTypes)
- CvLeague::GetCurrentSpecialSession() const
- CvLeague::GetLastSpecialSession() const
- CvLeagueSpecialSessionEntry::GetCityStateDelegates() const