CvHomelandAI::LogPatrolMessage(CvString &, CvUnit *)
- Defined in
- CvHomelandAI.cpp, line 5925
- Class
- CvHomelandAI
- Hook name
CivHooks::CvHomelandAI_LogPatrolMessage
Hooks
static bool BeforeCvHomelandAI_LogPatrolMessage(CvHomelandAI* self, CvString& strMsg, CvUnit* pPatrolUnit);static void AfterCvHomelandAI_LogPatrolMessage(CvHomelandAI* self, CvString& strMsg, CvUnit* pPatrolUnit);static void ReplaceCvHomelandAI_LogPatrolMessage(void (*original)(CvHomelandAI*, CvString&, CvUnit*), CvHomelandAI* self, CvString& strMsg, CvUnit* pPatrolUnit);CivRegisterBefore<CivHooks::CvHomelandAI_LogPatrolMessage>(host, &BeforeCvHomelandAI_LogPatrolMessage);CivRegisterAfter<CivHooks::CvHomelandAI_LogPatrolMessage>(host, &AfterCvHomelandAI_LogPatrolMessage);CivRegisterReplace<CivHooks::CvHomelandAI_LogPatrolMessage>(host, &ReplaceCvHomelandAI_LogPatrolMessage);
Code
5925void CvHomelandAI::LogPatrolMessage( CvString& strMsg, CvUnit* pPatrolUnit )5926{5927 if(!pPatrolUnit || !(GC.getLogging() && GC.getAILogging()))5928 {5929 return;5930 }59315932 // Open the log file5933 CvString strFileName = "PlayerHomelandAIPatrolLog.csv";5934 FILogFile* pLog;5935 pLog = LOGFILEMGR.GetLog(strFileName, FILogFile::kDontTimeStamp);59365937 CvString strLog, strTemp;59385939 CvString strPlayerName;5940 strPlayerName = m_pPlayer->getCivilizationShortDescription();5941 strLog += strPlayerName;5942 strLog += ",";59435944 strTemp.Format("%d,", GC.getGame().getGameTurn()); // turn5945 strLog += strTemp;59465947 strTemp.Format("%s (%d),", pPatrolUnit->getUnitInfo().GetDescription(), pPatrolUnit->GetID());5948 strLog += strTemp;59495950 strLog += strMsg;5951 pLog->Msg(strLog);5952}
Calls
- CvBaseInfo::GetDescription() const
- CvGame::getGameTurn()
- CvGlobals::getAILogging()
- CvGlobals::getGame()
- CvGlobals::getLogging()
- CvPlayer::getCivilizationShortDescription() const
CvString::CvStringCvString::CvStringCvString::FormatCvString::operator const char *CvString::operator=- CvUnit::GetID() const
- CvUnit::getUnitInfo() const
FILogFile::MsgFILogFileMgr::GetInstanceFILogFileMgr::GetLogstd::basic_string::operator+=std::basic_string::operator+=