Bazaar developer reference

CvTacticalAI::LogTacticalMessage(CvString &, bool)

Defined in
CvTacticalAI.cpp, line 11671
Class
CvTacticalAI
Hook name
CivHooks::CvTacticalAI_LogTacticalMessage

Hooks

static bool BeforeCvTacticalAI_LogTacticalMessage(CvTacticalAI* self, CvString& strMsg, bool bSkipLogDominanceZone);static void AfterCvTacticalAI_LogTacticalMessage(CvTacticalAI* self, CvString& strMsg, bool bSkipLogDominanceZone);static void ReplaceCvTacticalAI_LogTacticalMessage(void (*original)(CvTacticalAI*, CvString&, bool), CvTacticalAI* self, CvString& strMsg, bool bSkipLogDominanceZone);CivRegisterBefore<CivHooks::CvTacticalAI_LogTacticalMessage>(host, &BeforeCvTacticalAI_LogTacticalMessage);CivRegisterAfter<CivHooks::CvTacticalAI_LogTacticalMessage>(host, &AfterCvTacticalAI_LogTacticalMessage);CivRegisterReplace<CivHooks::CvTacticalAI_LogTacticalMessage>(host, &ReplaceCvTacticalAI_LogTacticalMessage);

Code

11670/// Log current status of the operation11671void CvTacticalAI::LogTacticalMessage(CvString& strMsg, bool bSkipLogDominanceZone)11672{11673	if(GC.getLogging() && GC.getAILogging())11674	{11675		CvString strOutBuf;11676		CvString strBaseString;11677		CvString strPlayerName;11678		CvString strTemp;11679		FILogFile* pLog;1168011681		strPlayerName = m_pPlayer->getCivilizationShortDescription();11682		pLog = LOGFILEMGR.GetLog(GetLogFileName(strPlayerName), FILogFile::kDontTimeStamp);1168311684		// Get the leading info for this line11685		strBaseString.Format("%03d, ", GC.getGame().getElapsedGameTurns());11686		strBaseString += strPlayerName + ", ";11687		strTemp = "no zone, ";11688		if(!bSkipLogDominanceZone)11689		{11690			CvTacticalDominanceZone* pZone = GC.getGame().GetTacticalAnalysisMap()->GetZone(m_iCurrentZoneIndex);11691			if(pZone != NULL)11692			{11693				strTemp.Format("Zone ID: %d, ", pZone->GetDominanceZoneID());11694			}11695		}11696		strBaseString += strTemp;11697		strOutBuf = strBaseString + strMsg;1169811699		pLog->Msg(strOutBuf);11700	}11701}

Calls

Called by

48 functions in 4 files