Project Alice
Loading...
Searching...
No Matches
diplomatic_message Namespace Reference

Classes

struct  message
 Holds data regarding a diplomatic message between two specified nations at a certain date, whether it be an alliance request, peace offer, calling an ally, etc. Also contains other optional data such as a pertinent war, crisis, state, etc. More...
 

Typedefs

using type = type_t
 

Enumerations

enum class  type_t : uint8_t {
  none = 0 , access_request = 1 , alliance_request = 2 , call_ally_request = 3 ,
  be_crisis_primary_defender = 4 , be_crisis_primary_attacker = 5 , peace_offer = 6 , take_crisis_side_offer = 7 ,
  crisis_peace_offer = 8 , state_transfer = 9
}
 

Functions

void decline (sys::state &state, message const &m)
 
bool can_accept_crisis_offer (sys::state &state, dcon::nation_id from, dcon::nation_id to, sys::full_wg offer)
 
void add_to_crisis_with_offer (sys::state &state, dcon::nation_id from, dcon::nation_id to, sys::full_wg offer)
 
bool can_accept_crisis_peace_offer (sys::state &state, dcon::nation_id from, dcon::nation_id to, dcon::peace_offer_id peace)
 
bool can_accept (sys::state &state, message const &m)
 
void accept (sys::state &state, message const &m)
 
bool ai_will_accept (sys::state &state, message const &m)
 Returns the appropriate acceptance evaluation for a given diplomatic message. It is required to define a new case and method for new diplomatic requests. More...
 
void post (sys::state &state, message const &m)
 Pushes a diplomatic message to the list of pending diplomatic requests for the specified recipient (m.to), will simply skip and evaluate a response immediately if the recipient is AI-controlled. More...
 
void update_pending (sys::state &state)
 

Variables

constexpr int32_t expiration_in_days = 15
 

Typedef Documentation

◆ type

Definition at line 53 of file diplomatic_messages.hpp.

Enumeration Type Documentation

◆ type_t

enum class diplomatic_message::type_t : uint8_t
strong
Enumerator
none 
access_request 
alliance_request 
call_ally_request 
be_crisis_primary_defender 
be_crisis_primary_attacker 
peace_offer 
take_crisis_side_offer 
crisis_peace_offer 
state_transfer 

Definition at line 11 of file diplomatic_messages.hpp.

Function Documentation

◆ accept()

void diplomatic_message::accept ( sys::state state,
message const &  m 
)

Definition at line 278 of file diplomatic_messages.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_to_crisis_with_offer()

void diplomatic_message::add_to_crisis_with_offer ( sys::state state,
dcon::nation_id  from,
dcon::nation_id  to,
sys::full_wg  offer 
)

Definition at line 187 of file diplomatic_messages.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ai_will_accept()

bool diplomatic_message::ai_will_accept ( sys::state state,
message const &  m 
)

Returns the appropriate acceptance evaluation for a given diplomatic message. It is required to define a new case and method for new diplomatic requests.

Parameters
state
m
Returns

Definition at line 382 of file diplomatic_messages.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ can_accept()

bool diplomatic_message::can_accept ( sys::state state,
message const &  m 
)

Definition at line 254 of file diplomatic_messages.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ can_accept_crisis_offer()

bool diplomatic_message::can_accept_crisis_offer ( sys::state state,
dcon::nation_id  from,
dcon::nation_id  to,
sys::full_wg  offer 
)

Definition at line 136 of file diplomatic_messages.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ can_accept_crisis_peace_offer()

bool diplomatic_message::can_accept_crisis_peace_offer ( sys::state state,
dcon::nation_id  from,
dcon::nation_id  to,
dcon::peace_offer_id  peace 
)

Definition at line 211 of file diplomatic_messages.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ decline()

void diplomatic_message::decline ( sys::state state,
message const &  m 
)

Definition at line 9 of file diplomatic_messages.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ post()

void diplomatic_message::post ( sys::state state,
message const &  m 
)

Pushes a diplomatic message to the list of pending diplomatic requests for the specified recipient (m.to), will simply skip and evaluate a response immediately if the recipient is AI-controlled.

Parameters
state
m

Definition at line 432 of file diplomatic_messages.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_pending()

void diplomatic_message::update_pending ( sys::state state)

Definition at line 456 of file diplomatic_messages.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ expiration_in_days

constexpr int32_t diplomatic_message::expiration_in_days = 15
inlineconstexpr

Definition at line 9 of file diplomatic_messages.hpp.