Bazaar developer reference

CvMilitaryAI::LogPeace(PlayerTypes)

Defined in
CvMilitaryAI.cpp, line 1971
Class
CvMilitaryAI
Hook name
CivHooks::CvMilitaryAI_LogPeace

Hooks

static bool BeforeCvMilitaryAI_LogPeace(CvMilitaryAI* self, PlayerTypes eOpponent);static void AfterCvMilitaryAI_LogPeace(CvMilitaryAI* self, PlayerTypes eOpponent);static void ReplaceCvMilitaryAI_LogPeace(void (*original)(CvMilitaryAI*, PlayerTypes), CvMilitaryAI* self, PlayerTypes eOpponent);CivRegisterBefore<CivHooks::CvMilitaryAI_LogPeace>(host, &BeforeCvMilitaryAI_LogPeace);CivRegisterAfter<CivHooks::CvMilitaryAI_LogPeace>(host, &AfterCvMilitaryAI_LogPeace);CivRegisterReplace<CivHooks::CvMilitaryAI_LogPeace>(host, &ReplaceCvMilitaryAI_LogPeace);

Code

1970/// Log it if we make peace1971void CvMilitaryAI::LogPeace(PlayerTypes eOpponent)1972{1973	if(GC.getLogging() && GC.getAILogging())1974	{1975		CvString strOutBuf;1976		CvString strBaseString;1977		CvString strOpponentName;1978		CvString strPlayerName;1979		CvString strTemp;1980		FILogFile* pLog;19811982		// Open the right file1983		strPlayerName = GetPlayer()->getCivilizationShortDescription();1984		strOpponentName = GET_PLAYER(eOpponent).getCivilizationShortDescription();1985		pLog = LOGFILEMGR.GetLog(GetLogFileName(strPlayerName), FILogFile::kDontTimeStamp);19861987		// Get the leading info for this line1988		strBaseString.Format("%03d, ", GC.getGame().getElapsedGameTurns());1989		strBaseString += strPlayerName + ", ";19901991		// Strategy Info1992		strTemp.Format("Made peace with: %s", strOpponentName.GetCString());1993		strOutBuf = strBaseString + strTemp;1994		pLog->Msg(strOutBuf);19951996		LogMilitarySummaryMessage(strTemp);1997	}1998}

Calls

Called by