CvVictoryInfo::CacheResults(Database::Results &, CvDatabaseUtility &)
- Defined in
- CvInfos.cpp, line 2609
- Class
- CvVictoryInfo
- Hook name
CivHooks::CvVictoryInfo_CacheResults- Overrides
- CvBaseInfo::CacheResults(Database::Results &, CvDatabaseUtility &)
Hooks
static bool BeforeCvVictoryInfo_CacheResults(CvVictoryInfo* self, Database::Results& kResults, CvDatabaseUtility& kUtility, bool& result);static void AfterCvVictoryInfo_CacheResults(CvVictoryInfo* self, Database::Results& kResults, CvDatabaseUtility& kUtility, bool& result);static bool ReplaceCvVictoryInfo_CacheResults(bool (*original)(CvVictoryInfo*, Database::Results&, CvDatabaseUtility&), CvVictoryInfo* self, Database::Results& kResults, CvDatabaseUtility& kUtility);CivRegisterBefore<CivHooks::CvVictoryInfo_CacheResults>(host, &BeforeCvVictoryInfo_CacheResults);CivRegisterAfter<CivHooks::CvVictoryInfo_CacheResults>(host, &AfterCvVictoryInfo_CacheResults);CivRegisterReplace<CivHooks::CvVictoryInfo_CacheResults>(host, &ReplaceCvVictoryInfo_CacheResults);
Code
2609bool CvVictoryInfo::CacheResults(Database::Results& kResults, CvDatabaseUtility& kUtility)2610{2611 if(!CvBaseInfo::CacheResults(kResults, kUtility))2612 return false;26132614 m_bWinsGame = kResults.GetBool("WinsGame");2615 m_bTargetScore = kResults.GetBool("TargetScore");2616 m_bEndScore = kResults.GetBool("EndScore");2617 m_bConquest = kResults.GetBool("Conquest");2618 m_bInfluential = kResults.GetBool("Influential");2619 m_bDiploVote = kResults.GetBool("DiploVote");2620 m_bPermanent = kResults.GetBool("Permanent");2621 m_bReligionInAllCities = kResults.GetBool("ReligionInAllCities");2622 m_bFindAllNaturalWonders = kResults.GetBool("FindAllNaturalWonders");2623 m_iPopulationPercentLead = kResults.GetInt("PopulationPercentLead");2624 m_iLandPercent = kResults.GetInt("LandPercent");2625 m_iMinLandPercent = kResults.GetInt("MinLandPercent");26262627 m_iNumCultureCities = kResults.GetInt("NumCultureCities");2628 m_iTotalCultureRatio = kResults.GetInt("TotalCultureRatio");2629 m_iVictoryDelayTurns = kResults.GetInt("VictoryDelayTurns");26302631 m_strMovie = kResults.GetText("VictoryMovie");26322633 const char* szCityCulture = kResults.GetText("CityCulture");2634 m_iCityCulture = GC.getInfoTypeForString(szCityCulture, true);26352636 //VictoryPointAwards2637 {2638 const char* szVictoryType = GetType();26392640 const int iNumVictoryPoints = GC.getNUM_VICTORY_POINT_AWARDS();2641 kUtility.InitializeArray(m_piVictoryPointAwards, iNumVictoryPoints);26422643 std::string strKey = "CvVictoryInfo_VictoryPointAwards";2644 Database::Results* pVictoryPointResults = kUtility.GetResults(strKey);2645 if(pVictoryPointResults == NULL)2646 {2647 pVictoryPointResults = kUtility.PrepareResults(strKey, "select VictoryPoints from VictoryPointAwards where VictoryType == ? order by VictoryPoints desc;");2648 }26492650 pVictoryPointResults->Bind(1, szVictoryType);26512652 int i = 0;2653 while(pVictoryPointResults->Step())2654 {2655 CvAssert(i < iNumVictoryPoints);2656 m_piVictoryPointAwards[i++] = pVictoryPointResults->GetInt(0);2657 }26582659 pVictoryPointResults->Reset();2660 }26612662 return true;2663}
Calls
- CvBaseInfo::CacheResults(Database::Results &, CvDatabaseUtility &)
- CvBaseInfo::GetType() const
- CvDatabaseUtility::GetResults(const std::string &)
- CvDatabaseUtility::InitializeArray(int *&, const size_t, int)
- CvDatabaseUtility::PrepareResults(const std::string &, const char *)
- CvGlobals::getInfoTypeForString(const char *, bool) const
- CvGlobals::getNUM_VICTORY_POINT_AWARDS()
CvString::operator=Database::Results::BindDatabase::Results::GetBoolDatabase::Results::GetIntDatabase::Results::GetIntDatabase::Results::GetTextDatabase::Results::ResetDatabase::Results::Stepstd::basic_string::basic_string