CvDiplomacyRequests::BeginTurn()
- Defined in
- CvDiplomacyRequests.cpp, line 189
- Class
- CvDiplomacyRequests
- Hook name
CivHooks::CvDiplomacyRequests_BeginTurn
Hooks
static bool BeforeCvDiplomacyRequests_BeginTurn(CvDiplomacyRequests* self);static void AfterCvDiplomacyRequests_BeginTurn(CvDiplomacyRequests* self);static void ReplaceCvDiplomacyRequests_BeginTurn(void (*original)(CvDiplomacyRequests*), CvDiplomacyRequests* self);CivRegisterBefore<CivHooks::CvDiplomacyRequests_BeginTurn>(host, &BeforeCvDiplomacyRequests_BeginTurn);CivRegisterAfter<CivHooks::CvDiplomacyRequests_BeginTurn>(host, &AfterCvDiplomacyRequests_BeginTurn);CivRegisterReplace<CivHooks::CvDiplomacyRequests_BeginTurn>(host, &ReplaceCvDiplomacyRequests_BeginTurn);
Code
188// Called from within CvPlayer at the beginning of the turn189void CvDiplomacyRequests::BeginTurn(void)190{191#if defined(MOD_AI_MP_DIPLOMACY)192 if (MOD_AI_MP_DIPLOMACY)193 {194 CvPlayer& kTo = GET_PLAYER(m_ePlayer);195 CvNotifications* pNotifications = kTo.GetNotifications();196 for (RequestList::iterator iter = m_aRequests.begin(); iter != m_aRequests.end(); ++iter)197 {198 if (iter->m_iLookupIndex < 0)199 {200 CvPlayer& kFrom = GET_PLAYER(iter->m_eFromPlayer);201 CvString leaderMessage = CvString::format("%s: %s", kFrom.getName(), iter->m_strMessage.c_str());202 iter->m_iLookupIndex = pNotifications->Add(NOTIFICATION_PLAYER_DEAL_RECEIVED, leaderMessage, kFrom.getCivilizationDescription(), iter->m_eFromPlayer, -2, -1, -1);203 }204 }205 } else 206#endif207 m_eNextAIPlayer = (PlayerTypes)0;208}
Calls
- CustomMods::isAI_MP_DIPLOMACY()
- CvNotifications::Add(NotificationTypes, const char *, const char *, int, int, int, int)
- CvPlayer::getCivilizationDescription() const
- CvPlayer::getName() const
- CvPlayer::GetNotifications() const
- CvPlayerAI::getPlayer(PlayerTypes)
CvString::formatCvString::operator const char *std::basic_string::c_strstd::list::_Const_iterator::operator!=std::list::_Iterator::operator++std::list::_Iterator::operator->std::list::beginstd::list::end