CvUnitPromotions::Write(FDataStream &) const
- Defined in
- CvPromotionClasses.cpp, line 2206
- Class
- CvUnitPromotions
- Hook name
CivHooks::CvUnitPromotions_Write
Hooks
static bool BeforeCvUnitPromotions_Write(const CvUnitPromotions* self, FDataStream& kStream);static void AfterCvUnitPromotions_Write(const CvUnitPromotions* self, FDataStream& kStream);static void ReplaceCvUnitPromotions_Write(void (*original)(const CvUnitPromotions*, FDataStream&), const CvUnitPromotions* self, FDataStream& kStream);CivRegisterBefore<CivHooks::CvUnitPromotions_Write>(host, &BeforeCvUnitPromotions_Write);CivRegisterAfter<CivHooks::CvUnitPromotions_Write>(host, &AfterCvUnitPromotions_Write);CivRegisterReplace<CivHooks::CvUnitPromotions_Write>(host, &ReplaceCvUnitPromotions_Write);
Code
2205/// Serialization write2206void CvUnitPromotions::Write(FDataStream& kStream) const2207{2208 // Current version number2209 uint uiVersion = 1;2210 kStream << uiVersion;2211 MOD_SERIALIZE_INIT_WRITE(kStream);22122213 // Write out number of promotions to save2214 int iNumPromotions = m_pPromotions->GetNumPromotions();2215 kStream << iNumPromotions;2216 CvAssertMsg(iNumPromotions > 0, "Number of promotions to serialize is expected to greater than 0");22172218 PromotionArrayHelpers::Write(kStream, m_kHasPromotion, iNumPromotions);2219}
Calls
- CvPromotionXMLEntries::GetNumPromotions()
FDataStream::operator<<FDataStream::operator<<- PromotionArrayHelpers::Write(FDataStream &, const CvBitfield &, int)