Bazaar developer reference

CvTechAI::LogPossibleResearch()

Defined in
CvTechAI.cpp, line 448
Class
CvTechAI
Hook name
CivHooks::CvTechAI_LogPossibleResearch

Hooks

static bool BeforeCvTechAI_LogPossibleResearch(CvTechAI* self);static void AfterCvTechAI_LogPossibleResearch(CvTechAI* self);static void ReplaceCvTechAI_LogPossibleResearch(void (*original)(CvTechAI*), CvTechAI* self);CivRegisterBefore<CivHooks::CvTechAI_LogPossibleResearch>(host, &BeforeCvTechAI_LogPossibleResearch);CivRegisterAfter<CivHooks::CvTechAI_LogPossibleResearch>(host, &AfterCvTechAI_LogPossibleResearch);CivRegisterReplace<CivHooks::CvTechAI_LogPossibleResearch>(host, &ReplaceCvTechAI_LogPossibleResearch);

Code

447/// Log all possible tech choices448void CvTechAI::LogPossibleResearch()449{450	if(GC.getLogging() && GC.getAILogging())451	{452		CvString strOutBuf;453		CvString strBaseString;454		CvString strTemp;455		CvString playerName;456		CvString strDesc;457458		// Find the name of this civ459		playerName = m_pCurrentTechs->GetPlayer()->getCivilizationShortDescription();460461		FILogFile* pLog = LOGFILEMGR.GetLog(GetLogFileName(playerName), FILogFile::kDontTimeStamp);462463		// Get the leading info for this line464		strBaseString.Format("%03d, ", GC.getGame().getElapsedGameTurns());465		strBaseString += playerName + ", ";466467		// Dump out the weight of each Researchable Tech468		for(int iI = 0; iI < m_ResearchableTechs.size(); iI++)469		{470			TechTypes eTech = (TechTypes) m_ResearchableTechs.GetElement(iI);471			int iWeight = m_ResearchableTechs.GetWeight(iI);472473			CvTechEntry* pTechEntry = GC.getTechInfo(eTech);474			const char* szTechType = (pTechEntry != NULL)? pTechEntry->GetType() : "Unknown Tech";475476			strTemp.Format("%s, %d", szTechType, iWeight);477478			strOutBuf = strBaseString + strTemp;479			pLog->Msg(strOutBuf);480		}481	}482}

Calls

Called by