CvDiplomacyAI::LogPeaceMade(PlayerTypes)
- Defined in
- CvDiplomacyAI.cpp, line 25496
- Class
- CvDiplomacyAI
- Hook name
CivHooks::CvDiplomacyAI_LogPeaceMade
Hooks
static bool BeforeCvDiplomacyAI_LogPeaceMade(CvDiplomacyAI* self, PlayerTypes ePlayer);static void AfterCvDiplomacyAI_LogPeaceMade(CvDiplomacyAI* self, PlayerTypes ePlayer);static void ReplaceCvDiplomacyAI_LogPeaceMade(void (*original)(CvDiplomacyAI*, PlayerTypes), CvDiplomacyAI* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvDiplomacyAI_LogPeaceMade>(host, &BeforeCvDiplomacyAI_LogPeaceMade);CivRegisterAfter<CivHooks::CvDiplomacyAI_LogPeaceMade>(host, &AfterCvDiplomacyAI_LogPeaceMade);CivRegisterReplace<CivHooks::CvDiplomacyAI_LogPeaceMade>(host, &ReplaceCvDiplomacyAI_LogPeaceMade);
Code
25495/// Log war declaration25496void CvDiplomacyAI::LogPeaceMade(PlayerTypes ePlayer)25497{25498 if(GC.getLogging() && GC.getAILogging())25499 {25500 CvString strOutBuf;25501 CvString strBaseString;25502 CvString playerName;25503 CvString otherPlayerName;25504 CvString strDesc;25505 CvString strLogName;2550625507 // Find the name of this civ and city25508 playerName = GetPlayer()->getCivilizationShortDescription();2550925510 // Open the log file25511 if(GC.getPlayerAndCityAILogSplit())25512 {25513 strLogName = "DiplomacyAI_Log_" + playerName + ".csv";25514 }25515 else25516 {25517 strLogName = "DiplomacyAI_Log.csv";25518 }2551925520 FILogFile* pLog;25521 pLog = LOGFILEMGR.GetLog(strLogName, FILogFile::kDontTimeStamp);2552225523 // Get the leading info for this line25524 strBaseString.Format("%03d, ", GC.getGame().getElapsedGameTurns());25525 strBaseString += playerName + ", ";2552625527 otherPlayerName = GET_PLAYER(ePlayer).getCivilizationShortDescription();25528 strOutBuf = strBaseString + ", ***** PEACE MADE! *****, " + otherPlayerName;2552925530 pLog->Msg(strOutBuf);2553125532 OutputDebugString("\n");25533 OutputDebugString(strOutBuf);25534 OutputDebugString("\n");2553525536 // Want this in DiploMessage Log25537// if (!GET_PLAYER(ePlayer).isMinorCiv())25538 {25539 if(GC.getPlayerAndCityAILogSplit())25540 {25541 strLogName = "DiplomacyAI_Messages_Log_" + playerName + ".csv";25542 }25543 else25544 {25545 strLogName = "DiplomacyAI_Messages_Log.csv";25546 }25547 pLog = LOGFILEMGR.GetLog(strLogName, FILogFile::kDontTimeStamp);25548 pLog->Msg(strOutBuf);25549 }2555025551 // Log it to military AI too25552 m_pPlayer->GetMilitaryAI()->LogPeace(ePlayer);25553 }25554}
Calls
- CvDiplomacyAI::GetPlayer()
- CvGame::getElapsedGameTurns() const
- CvGlobals::getAILogging()
- CvGlobals::getGame()
- CvGlobals::getLogging()
- CvGlobals::getPlayerAndCityAILogSplit()
- CvMilitaryAI::LogPeace(PlayerTypes)
- CvPlayer::getCivilizationShortDescription() const
- CvPlayer::GetMilitaryAI() const
- CvPlayerAI::getPlayer(PlayerTypes)
CvString::CvStringCvString::FormatCvString::operator const char *CvString::operator=CvString::operator=FILogFile::MsgFILogFileMgr::GetInstanceFILogFileMgr::GetLogstd::basic_string::operator+=std::operator+std::operator+std::operator+