Bazaar developer reference

CvLeague::GetSessionTurnInterval()

Defined in
CvVotingClasses.cpp, line 1995
Class
CvLeague
Hook name
CivHooks::CvLeague_GetSessionTurnInterval

Hooks

static bool BeforeCvLeague_GetSessionTurnInterval(CvLeague* self, int& result);static void AfterCvLeague_GetSessionTurnInterval(CvLeague* self, int& result);static int ReplaceCvLeague_GetSessionTurnInterval(int (*original)(CvLeague*), CvLeague* self);CivRegisterBefore<CivHooks::CvLeague_GetSessionTurnInterval>(host, &BeforeCvLeague_GetSessionTurnInterval);CivRegisterAfter<CivHooks::CvLeague_GetSessionTurnInterval>(host, &AfterCvLeague_GetSessionTurnInterval);CivRegisterReplace<CivHooks::CvLeague_GetSessionTurnInterval>(host, &ReplaceCvLeague_GetSessionTurnInterval);

Code

1995int CvLeague::GetSessionTurnInterval()1996{1997	// Determined by most recent special session1998	int iInterval = GC.getLEAGUE_SESSION_INTERVAL_BASE_TURNS();1999	if (GetCurrentSpecialSession() != NO_LEAGUE_SPECIAL_SESSION)2000	{2001		CvLeagueSpecialSessionEntry* pInfo = GC.getLeagueSpecialSessionInfo(GetCurrentSpecialSession());2002		CvAssert(pInfo != NULL);2003		if (pInfo != NULL)2004		{2005			iInterval = pInfo->GetTurnsBetweenSessions();2006		}2007	}2008	else if (GetLastSpecialSession() != NO_LEAGUE_SPECIAL_SESSION)2009	{2010		CvLeagueSpecialSessionEntry* pInfo = GC.getLeagueSpecialSessionInfo(GetLastSpecialSession());2011		CvAssert(pInfo != NULL);2012		if (pInfo != NULL)2013		{2014			iInterval = pInfo->GetTurnsBetweenSessions();2015		}2016	}20172018	// Modified by game speed2019	iInterval = (iInterval * GC.getGame().getGameSpeedInfo().getLeaguePercent()) / 100;20202021	if (DEBUG_LEAGUES)2022	{2023		return 2;2024	}20252026	return iInterval;2027}

Calls

Called by