Bazaar developer reference

CvWonderProductionAI::LogPossibleWonders()

Defined in
CvWonderProductionAI.cpp, line 509
Class
CvWonderProductionAI
Hook name
CivHooks::CvWonderProductionAI_LogPossibleWonders

Hooks

static bool BeforeCvWonderProductionAI_LogPossibleWonders(CvWonderProductionAI* self);static void AfterCvWonderProductionAI_LogPossibleWonders(CvWonderProductionAI* self);static void ReplaceCvWonderProductionAI_LogPossibleWonders(void (*original)(CvWonderProductionAI*), CvWonderProductionAI* self);CivRegisterBefore<CivHooks::CvWonderProductionAI_LogPossibleWonders>(host, &BeforeCvWonderProductionAI_LogPossibleWonders);CivRegisterAfter<CivHooks::CvWonderProductionAI_LogPossibleWonders>(host, &AfterCvWonderProductionAI_LogPossibleWonders);CivRegisterReplace<CivHooks::CvWonderProductionAI_LogPossibleWonders>(host, &ReplaceCvWonderProductionAI_LogPossibleWonders);

Code

508/// Log all potential builds509void CvWonderProductionAI::LogPossibleWonders()510{511	if(GC.getLogging() && GC.getAILogging())512	{513		// Find the name of this civ514		CvString playerName = m_pPlayer->getCivilizationShortDescription();515516		// Open the log file517		FILogFile* pLog = LOGFILEMGR.GetLog(m_pPlayer->GetCitySpecializationAI()->GetLogFileName(playerName), FILogFile::kDontTimeStamp);518519		// Get the leading info for this line520		CvString strBaseString;521		strBaseString.Format("%03d, ", GC.getGame().getElapsedGameTurns());522		strBaseString += playerName + ", ";523524525526		// Dump out the weight of each buildable item527		for(int iI = 0; iI < m_Buildables.size(); iI++)528		{529			CvString strOutBuf = strBaseString;530531			CvBuildingEntry* pEntry = GC.GetGameBuildings()->GetEntry(m_Buildables.GetElement(iI));532			if(pEntry != NULL)533			{534				CvString strDesc = pEntry->GetDescription();535				CvString strTemp;536				strTemp.Format("Wonder, %s, %d", strDesc.GetCString(), m_Buildables.GetWeight(iI));537				strOutBuf += strTemp;538539			}540541			pLog->Msg(strOutBuf);542		}543	}544}

Calls

Called by