PromotionArrayHelpers::ReadV3(FDataStream &, CvBitfield &)
- Defined in
- CvPromotionClasses.cpp, line 2401
- Hook name
CivHooks::PromotionArrayHelpers_ReadV3
Hooks
static bool BeforePromotionArrayHelpers_ReadV3(FDataStream& kStream, CvBitfield& kPromotions);static void AfterPromotionArrayHelpers_ReadV3(FDataStream& kStream, CvBitfield& kPromotions);static void ReplacePromotionArrayHelpers_ReadV3(void (*original)(FDataStream&, CvBitfield&), FDataStream& kStream, CvBitfield& kPromotions);CivRegisterBefore<CivHooks::PromotionArrayHelpers_ReadV3>(host, &BeforePromotionArrayHelpers_ReadV3);CivRegisterAfter<CivHooks::PromotionArrayHelpers_ReadV3>(host, &AfterPromotionArrayHelpers_ReadV3);CivRegisterReplace<CivHooks::PromotionArrayHelpers_ReadV3>(host, &ReplacePromotionArrayHelpers_ReadV3);
Code
2400// Read the saved promotions. Entries are saved as string values, all entries are saved.2401void PromotionArrayHelpers::ReadV3(FDataStream& kStream, CvBitfield& kPromotions)2402{2403 int iNumEntries;2404 FStringFixedBuffer(sTemp, 64);2405 int iType;24062407 kStream >> iNumEntries;24082409 kPromotions.SetSize( iNumEntries );24102411 for(int iI = 0; iI < iNumEntries; iI++)2412 {2413 kStream >> sTemp;2414 if(sTemp == "PROMOTION_OLIGARCHY")2415 {2416 bool bTemp;2417 kStream >> bTemp;2418 }2419 else2420 {2421 iType = GC.getInfoTypeForString(sTemp);2422 if(iType != -1)2423 {2424 bool bValue;2425 kStream >> bValue;2426 kPromotions.SetBit(iType, bValue);2427 }2428 else2429 {2430 CvString szError;2431 szError.Format("LOAD ERROR: Promotion Type not found: %s", sTemp);2432 GC.LogMessage(szError.GetCString());2433 CvAssertMsg(false, szError);2434 bool bDummy;2435 kStream >> bDummy;2436 }2437 }2438 }2439}
Calls
- CvBitfield::SetBit(uint, bool)
- CvBitfield::SetSize(uint)
- CvGlobals::getInfoTypeForString(const char *, bool) const
- CvGlobals::LogMessage(const char *)
CvString::CvStringCvString::FormatCvString::GetCStringFDataStream::operator>>FDataStream::operator>>FDataStream::operator>>FStringA::FStringAFStringA::FStringAFStringA::FStringAFixedBuffer::FStringAFixedBufferFStringA::operator const char *FStringA::operator==