Bazaar developer reference

CvReplayInfo::getPlotState(unsigned int, unsigned int, unsigned int, PlotState &) const

Defined in
CvReplayInfo.cpp, line 500
Class
CvReplayInfo
Hook name
CivHooks::CvReplayInfo_getPlotState

Hooks

static bool BeforeCvReplayInfo_getPlotState(const CvReplayInfo* self, unsigned int x, unsigned int y, unsigned int uiTurn, PlotState& plotState, bool& result);static void AfterCvReplayInfo_getPlotState(const CvReplayInfo* self, unsigned int x, unsigned int y, unsigned int uiTurn, PlotState& plotState, bool& result);static bool ReplaceCvReplayInfo_getPlotState(bool (*original)(const CvReplayInfo*, unsigned int, unsigned int, unsigned int, PlotState&), const CvReplayInfo* self, unsigned int x, unsigned int y, unsigned int uiTurn, PlotState& plotState);// CivHooks.h gives this hook point no types, so nothing checks these hooks' parameters.host->RegisterHook(host->pluginIndex, CivHooks::CvReplayInfo_getPlotState::ID, CIV_HOOK_BEFORE, (void*)&BeforeCvReplayInfo_getPlotState);host->RegisterHook(host->pluginIndex, CivHooks::CvReplayInfo_getPlotState::ID, CIV_HOOK_AFTER, (void*)&AfterCvReplayInfo_getPlotState);host->RegisterHook(host->pluginIndex, CivHooks::CvReplayInfo_getPlotState::ID, CIV_HOOK_REPLACE, (void*)&ReplaceCvReplayInfo_getPlotState);

Code

500bool CvReplayInfo::getPlotState(unsigned int x, unsigned int y, unsigned int uiTurn, PlotState& plotState) const501{502	size_t idx = x + y * m_iMapWidth;503	if(idx < m_listPlots.size())504	{505		const PlotStatePerTurn& plotStatePerTurn = m_listPlots[idx];506		PlotStatePerTurn::const_iterator match = plotStatePerTurn.find(uiTurn);507		if(match != plotStatePerTurn.end())508		{509			plotState = (*match).second;510			return true;511		}512	}513514	return false;515}

Calls

Called by