Bazaar developer reference

CvNotifications::Read(FDataStream &)

Defined in
CvNotifications.cpp, line 274
Class
CvNotifications
Hook name
CivHooks::CvNotifications_Read

Hooks

static bool BeforeCvNotifications_Read(CvNotifications* self, FDataStream& kStream);static void AfterCvNotifications_Read(CvNotifications* self, FDataStream& kStream);static void ReplaceCvNotifications_Read(void (*original)(CvNotifications*, FDataStream&), CvNotifications* self, FDataStream& kStream);CivRegisterBefore<CivHooks::CvNotifications_Read>(host, &BeforeCvNotifications_Read);CivRegisterAfter<CivHooks::CvNotifications_Read>(host, &AfterCvNotifications_Read);CivRegisterReplace<CivHooks::CvNotifications_Read>(host, &ReplaceCvNotifications_Read);

Code

273/// Serialization read274void CvNotifications::Read(FDataStream& kStream)275{276	// Version number to maintain backwards compatibility277	uint uiVersion;278	kStream >> uiVersion;279	MOD_SERIALIZE_INIT_READ(kStream);280281	kStream >> m_ePlayer;282	kStream >> m_iCurrentLookupIndex;283	kStream >> m_iNotificationsBeginIndex;284	kStream >> m_iNotificationsEndIndex;285286	for(uint ui = 0; ui < MAX_NOTIFICATIONS; ui++)287	{288		kStream >> m_aNotifications[ui];289		if (uiVersion <= 1)290		{291			// Translate the old index the hash ID.292			int iIndex = (int)(m_aNotifications[ui].m_eNotificationType);293			if (iIndex >= 0 && iIndex < sizeof(V1_IndexToHash)/sizeof(uint))294				m_aNotifications[ui].m_eNotificationType = (NotificationTypes)V1_IndexToHash[iIndex];295		}296	}297}

Calls

Called by