Bazaar developer reference

CvMilitaryAI::LogCityRazed(CvCity *, PlayerTypes)

Defined in
CvMilitaryAI.cpp, line 1938
Class
CvMilitaryAI
Hook name
CivHooks::CvMilitaryAI_LogCityRazed

Hooks

static bool BeforeCvMilitaryAI_LogCityRazed(CvMilitaryAI* self, CvCity* pCity, PlayerTypes eOldOwner);static void AfterCvMilitaryAI_LogCityRazed(CvMilitaryAI* self, CvCity* pCity, PlayerTypes eOldOwner);static void ReplaceCvMilitaryAI_LogCityRazed(void (*original)(CvMilitaryAI*, CvCity*, PlayerTypes), CvMilitaryAI* self, CvCity* pCity, PlayerTypes eOldOwner);CivRegisterBefore<CivHooks::CvMilitaryAI_LogCityRazed>(host, &BeforeCvMilitaryAI_LogCityRazed);CivRegisterAfter<CivHooks::CvMilitaryAI_LogCityRazed>(host, &AfterCvMilitaryAI_LogCityRazed);CivRegisterReplace<CivHooks::CvMilitaryAI_LogCityRazed>(host, &ReplaceCvMilitaryAI_LogCityRazed);

Code

1937/// Log it if we raze a city1938void CvMilitaryAI::LogCityRazed(CvCity* pCity, PlayerTypes eOldOwner)1939{1940	if(GC.getLogging() && GC.getAILogging())1941	{1942		CvString strOutBuf;1943		CvString strBaseString;1944		CvString strPlayerName;1945		CvString strOldOwnerName;1946		CvString strCityName;1947		CvString strTemp;1948		FILogFile* pLog;19491950		// Open the right file1951		strPlayerName = GetPlayer()->getCivilizationShortDescription();1952		strOldOwnerName = GET_PLAYER(eOldOwner).getCivilizationShortDescription();1953		strCityName = pCity->getName();1954		pLog = LOGFILEMGR.GetLog(GetLogFileName(strPlayerName), FILogFile::kDontTimeStamp);19551956		// Get the leading info for this line1957		strBaseString.Format("%03d, ", GC.getGame().getElapsedGameTurns());1958		strBaseString += strPlayerName + ", ";19591960		// Strategy Info1961		strTemp = "Razed: " + strCityName + ", ";1962		strTemp += "From: " + strOldOwnerName;1963		strOutBuf = strBaseString + strTemp;1964		pLog->Msg(strOutBuf);19651966		LogMilitarySummaryMessage(strTemp);1967	}1968}

Calls