CvDiplomacyAI::LogMilitaryThreat(CvString &, PlayerTypes)
- Defined in
- CvDiplomacyAI.cpp, line 27286
- Class
- CvDiplomacyAI
- Hook name
CivHooks::CvDiplomacyAI_LogMilitaryThreat
Hooks
static bool BeforeCvDiplomacyAI_LogMilitaryThreat(CvDiplomacyAI* self, CvString& strString, PlayerTypes ePlayer);static void AfterCvDiplomacyAI_LogMilitaryThreat(CvDiplomacyAI* self, CvString& strString, PlayerTypes ePlayer);static void ReplaceCvDiplomacyAI_LogMilitaryThreat(void (*original)(CvDiplomacyAI*, CvString&, PlayerTypes), CvDiplomacyAI* self, CvString& strString, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvDiplomacyAI_LogMilitaryThreat>(host, &BeforeCvDiplomacyAI_LogMilitaryThreat);CivRegisterAfter<CivHooks::CvDiplomacyAI_LogMilitaryThreat>(host, &AfterCvDiplomacyAI_LogMilitaryThreat);CivRegisterReplace<CivHooks::CvDiplomacyAI_LogMilitaryThreat>(host, &ReplaceCvDiplomacyAI_LogMilitaryThreat);
Code
27285/// Log Military Threat27286void CvDiplomacyAI::LogMilitaryThreat(CvString& strString, PlayerTypes ePlayer)27287{27288 CvString strTemp;2728927290 // Don't fill out this field for Minors, as it just makes the log harder to read27291 if(GET_PLAYER(ePlayer).isMinorCiv())27292 {27293 strTemp.Format("");27294 }27295 else27296 {27297 switch(GetMilitaryThreat(ePlayer))27298 {27299 case THREAT_CRITICAL:27300 strTemp.Format("M_THT **CRITICAL**");27301 break;27302 case THREAT_SEVERE:27303 strTemp.Format("M_THT SEVERE");27304 break;27305 case THREAT_MAJOR:27306 strTemp.Format("M_THT Major");27307 break;27308 case THREAT_MINOR:27309 strTemp.Format("M_THT mnr");27310 break;27311 case THREAT_NONE:27312 strTemp.Format("M_THT N");27313 break;27314 default:27315 strTemp.Format("XXX");27316 break;27317 }27318 }2731927320 strString += ", " + strTemp;27321}
Calls
- CvDiplomacyAI::GetMilitaryThreat(PlayerTypes) const
- CvPlayer::isMinorCiv() const
- CvPlayerAI::getPlayer(PlayerTypes)
CvString::CvStringCvString::Formatstd::basic_string::operator+=std::operator+