CvPolicyAI::LogBranchChoice(PolicyBranchTypes)
- Defined in
- CvPolicyAI.cpp, line 966
- Class
- CvPolicyAI
- Hook name
CivHooks::CvPolicyAI_LogBranchChoice
Hooks
static bool BeforeCvPolicyAI_LogBranchChoice(CvPolicyAI* self, PolicyBranchTypes eBranch);static void AfterCvPolicyAI_LogBranchChoice(CvPolicyAI* self, PolicyBranchTypes eBranch);static void ReplaceCvPolicyAI_LogBranchChoice(void (*original)(CvPolicyAI*, PolicyBranchTypes), CvPolicyAI* self, PolicyBranchTypes eBranch);CivRegisterBefore<CivHooks::CvPolicyAI_LogBranchChoice>(host, &BeforeCvPolicyAI_LogBranchChoice);CivRegisterAfter<CivHooks::CvPolicyAI_LogBranchChoice>(host, &AfterCvPolicyAI_LogBranchChoice);CivRegisterReplace<CivHooks::CvPolicyAI_LogBranchChoice>(host, &ReplaceCvPolicyAI_LogBranchChoice);
Code
965/// Log chosen policy966void CvPolicyAI::LogBranchChoice(PolicyBranchTypes eBranch)967{968 if(GC.getLogging() && GC.getAILogging())969 {970 CvString strOutBuf;971 CvString strBaseString;972 CvString strTemp;973 CvString playerName;974 CvString strDesc;975976 // Find the name of this civ and city977 playerName = m_pCurrentPolicies->GetPlayer()->getCivilizationShortDescription();978979 FILogFile* pLog;980 pLog = LOGFILEMGR.GetLog(GetLogFileName(playerName), FILogFile::kDontTimeStamp);981982 // Get the leading info for this line983 strBaseString.Format("%03d, ", GC.getGame().getElapsedGameTurns());984 strBaseString += playerName + ", ";985986 strTemp.Format("CHOSEN, Branch %d", eBranch);987988 strOutBuf = strBaseString + strTemp;989 pLog->Msg(strOutBuf);990 }991}
Calls
- CvGame::getElapsedGameTurns() const
- CvGlobals::getAILogging()
- CvGlobals::getGame()
- CvGlobals::getLogging()
- CvPlayer::getCivilizationShortDescription() const
- CvPlayerPolicies::GetPlayer()
- CvPolicyAI::GetLogFileName(CvString &) const
CvString::CvStringCvString::FormatCvString::operator const char *CvString::operator=CvString::operator=FILogFile::MsgFILogFileMgr::GetInstanceFILogFileMgr::GetLogstd::basic_string::operator+=std::operator+std::operator+