CvDiplomacyAI::LogWantRA(PlayerTypes)
- Defined in
- CvDiplomacyAI.cpp, line 25752
- Class
- CvDiplomacyAI
- Hook name
CivHooks::CvDiplomacyAI_LogWantRA
Hooks
static bool BeforeCvDiplomacyAI_LogWantRA(CvDiplomacyAI* self, PlayerTypes ePlayer);static void AfterCvDiplomacyAI_LogWantRA(CvDiplomacyAI* self, PlayerTypes ePlayer);static void ReplaceCvDiplomacyAI_LogWantRA(void (*original)(CvDiplomacyAI*, PlayerTypes), CvDiplomacyAI* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvDiplomacyAI_LogWantRA>(host, &BeforeCvDiplomacyAI_LogWantRA);CivRegisterAfter<CivHooks::CvDiplomacyAI_LogWantRA>(host, &AfterCvDiplomacyAI_LogWantRA);CivRegisterReplace<CivHooks::CvDiplomacyAI_LogWantRA>(host, &ReplaceCvDiplomacyAI_LogWantRA);
Code
25751/// Log player wanting a RA25752void CvDiplomacyAI::LogWantRA(PlayerTypes ePlayer)25753{25754 if(GC.getLogging() && GC.getAILogging())25755 {25756 CvString strOutBuf;25757 CvString strBaseString;25758 CvString playerName;25759 CvString otherPlayerName;25760 CvString strDesc;25761 CvString strLogName;2576225763 // Find the name of this civ and city25764 playerName = GetPlayer()->getCivilizationShortDescription();2576525766 // Open the log file25767 if(GC.getPlayerAndCityAILogSplit())25768 {25769 strLogName = "DiplomacyAI_Messages_Log_" + playerName + ".csv";25770 }25771 else25772 {25773 strLogName = "DiplomacyAI_Messages_Log.csv";25774 }2577525776 FILogFile* pLog;25777 pLog = LOGFILEMGR.GetLog(strLogName, FILogFile::kDontTimeStamp);2577825779 // Get the leading info for this line25780 strBaseString.Format("%03d, ", GC.getGame().getElapsedGameTurns());25781 strBaseString += playerName + ", ";2578225783 otherPlayerName = GET_PLAYER(ePlayer).getCivilizationShortDescription();25784 strOutBuf = strBaseString + otherPlayerName + ", Wants Research Agreement!";2578525786 pLog->Msg(strOutBuf);2578725788 OutputDebugString("\n");25789 OutputDebugString(strOutBuf);25790 OutputDebugString("\n");25791 }25792}
Calls
- CvDiplomacyAI::GetPlayer()
- CvGame::getElapsedGameTurns() const
- CvGlobals::getAILogging()
- CvGlobals::getGame()
- CvGlobals::getLogging()
- CvGlobals::getPlayerAndCityAILogSplit()
- CvPlayer::getCivilizationShortDescription() 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+