Symphony Of Empires
Nation Class Reference

#include <nation.hpp>

Inheritance diagram for Nation:
Collaboration diagram for Nation:

Classes

struct  ClientHint
 Hints for the client on how to display the nation. More...
 
struct  Relation
 Diplomatic relations between two nations. More...
 

Public Member Functions

void declare_war (Nation &nation, std::vector< TreatyClause::BaseClause * > clauses=std::vector< TreatyClause::BaseClause * >())
 Declare war. More...
 
bool is_ally (const Nation &nation) const
 
bool is_enemy (const Nation &nation) const
 
void auto_relocate_capital ()
 Automatically relocates the capital of a nation to another province Use this when a treaty makes a nation lose it's capital. More...
 
void set_policy (const Policies &policies)
 Enacts a policy on a nation. More...
 
bool is_accepted_language (const Language &language) const
 Checks if a LANGUAGE is part of one of our accepted languages. More...
 
bool is_accepted_religion (const Religion &relgion) const
 Checks if a RELIGION is part of one of our accepted relgion. More...
 
float get_tax (const Pop &pop) const
 Gets the total tax applied to a POP depending on their "wealth" (not exactly like that, more like by their type/status) More...
 
void give_province (Province &province)
 Gives this nation a specified province (for example on a treaty) More...
 
void control_province (Province &province)
 
const Nation::ClientHintget_client_hint () const
 
float get_research_points () const
 
bool can_research (const Technology &tech) const
 
void change_research_focus (const Technology &tech)
 
void get_allies (std::function< void(const Nation &)> fn) const
 
bool exists () const
 Whetever the nation exists at all - we cannot add nations in-game so we just check if the nation "exists" at all, this means that it has a presence and a goverment must own atleast 1 province. More...
 
const Ideology::Subideologyget_subideology () const
 
bool can_directly_control_factories () const
 
void make_puppet (const Nation &master)
 
bool is_puppeted_by (const Nation &master) const
 
- Public Member Functions inherited from Entity< T >
constexpr Entity () noexcept=default
 
constexpr Entity (Entity &&) noexcept=default
 
constexpr Entity (const Entity &) noexcept=default
 
constexpr Entityoperator= (const Entity &) noexcept=default
 
constexpr ~Entity () noexcept=default
 
constexpr bool is_invalid () const
 Checks if the current id is invalid. More...
 
constexpr bool is_valid () const
 Checks if the current id is valid. More...
 
constexpr operator Id () const noexcept
 
constexpr operator size_t () const noexcept
 
constexpr Id get_id () const
 

Public Attributes

Eng3D::StringRef name
 
float prestige = 0.1f
 
float budget = 10000.f
 
bool ai_controlled = true
 
bool ai_do_cmd_troops = true
 
bool is_puppeted = false
 
NationId puppet_master_id
 
ProvinceId capital_id
 
IdeologyId ideology_id
 
SubideologyId subideology_id
 
TechnologyId focus_tech_id
 
Policies current_policy
 
std::vector< float > commodity_production
 
uint16_t diplomatic_timer
 
std::vector< float > language_acceptance
 
std::vector< float > religion_discrim
 
std::vector< ProvinceIdowned_provinces
 
std::vector< ProvinceIdcontrolled_provinces
 
std::deque< Eventinbox
 
std::vector< float > research
 
std::vector< Nation::ClientHintclient_hints
 
std::unordered_map< std::string, float > flags
 
std::string client_username
 
- Public Attributes inherited from RefnameEntity< NationId >
Eng3D::StringRef ref_name
 
- Public Attributes inherited from Entity< T >
Id cached_id
 Id used to speed up Id lookups on any context. More...
 

Additional Inherited Members

- Public Types inherited from Entity< T >
using Id = T
 
- Static Public Member Functions inherited from Entity< T >
constexpr static Id invalid ()
 Returns an invalid id. More...
 
constexpr static bool is_invalid (Id id)
 Checks if the id is not valid. More...
 
constexpr static bool is_valid (Id id)
 Checks if the id is valid. More...
 

Detailed Description

Definition at line 49 of file nation.hpp.

Member Function Documentation

◆ auto_relocate_capital()

void Nation::auto_relocate_capital ( )

Automatically relocates the capital of a nation to another province Use this when a treaty makes a nation lose it's capital.

Definition at line 120 of file nation.cpp.

Here is the call graph for this function:

◆ can_directly_control_factories()

bool Nation::can_directly_control_factories ( ) const

Definition at line 244 of file nation.cpp.

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

◆ can_research()

bool Nation::can_research ( const Technology tech) const

Definition at line 218 of file nation.cpp.

Here is the caller graph for this function:

◆ change_research_focus()

void Nation::change_research_focus ( const Technology tech)

Definition at line 226 of file nation.cpp.

Here is the call graph for this function:

◆ control_province()

void Nation::control_province ( Province province)

Definition at line 170 of file nation.cpp.

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

◆ declare_war()

void Nation::declare_war ( Nation nation,
std::vector< TreatyClause::BaseClause * >  clauses = std::vector<TreatyClause::BaseClause*>() 
)

Declare war.

Todo:
Make some form of "WarParticipationRequest" so we don't force allies to join and we also make sure betrayals are possible

Definition at line 43 of file nation.cpp.

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

◆ exists()

bool Nation::exists ( ) const
inline

Whetever the nation exists at all - we cannot add nations in-game so we just check if the nation "exists" at all, this means that it has a presence and a goverment must own atleast 1 province.

Definition at line 107 of file nation.hpp.

◆ get_allies()

void Nation::get_allies ( std::function< void(const Nation &)>  fn) const

Definition at line 232 of file nation.cpp.

Here is the call graph for this function:

◆ get_client_hint()

const Nation::ClientHint & Nation::get_client_hint ( ) const

Definition at line 202 of file nation.cpp.

Here is the caller graph for this function:

◆ get_research_points()

float Nation::get_research_points ( ) const

Definition at line 206 of file nation.cpp.

Here is the call graph for this function:

◆ get_subideology()

const Ideology::Subideology & Nation::get_subideology ( ) const

Definition at line 239 of file nation.cpp.

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

◆ get_tax()

float Nation::get_tax ( const Pop pop) const

Gets the total tax applied to a POP depending on their "wealth" (not exactly like that, more like by their type/status)

Definition at line 147 of file nation.cpp.

◆ give_province()

void Nation::give_province ( Province province)

Gives this nation a specified province (for example on a treaty)

Definition at line 156 of file nation.cpp.

Here is the call graph for this function:

◆ is_accepted_language()

bool Nation::is_accepted_language ( const Language language) const

Checks if a LANGUAGE is part of one of our accepted languages.

Definition at line 136 of file nation.cpp.

◆ is_accepted_religion()

bool Nation::is_accepted_religion ( const Religion relgion) const

Checks if a RELIGION is part of one of our accepted relgion.

Definition at line 141 of file nation.cpp.

◆ is_ally()

bool Nation::is_ally ( const Nation nation) const

Definition at line 108 of file nation.cpp.

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

◆ is_enemy()

bool Nation::is_enemy ( const Nation nation) const

Definition at line 114 of file nation.cpp.

Here is the call graph for this function:

◆ is_puppeted_by()

bool Nation::is_puppeted_by ( const Nation master) const
inline

Definition at line 121 of file nation.hpp.

Here is the call graph for this function:

◆ make_puppet()

void Nation::make_puppet ( const Nation master)
inline

Definition at line 116 of file nation.hpp.

Here is the call graph for this function:

◆ set_policy()

void Nation::set_policy ( const Policies policies)

Enacts a policy on a nation.

Returns
false if policy draft failed to be applied, true if policy passed and is in-effect

Definition at line 130 of file nation.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ ai_controlled

bool Nation::ai_controlled = true

Definition at line 131 of file nation.hpp.

◆ ai_do_cmd_troops

bool Nation::ai_do_cmd_troops = true

Definition at line 132 of file nation.hpp.

◆ budget

float Nation::budget = 10000.f

Definition at line 129 of file nation.hpp.

◆ capital_id

ProvinceId Nation::capital_id

Definition at line 136 of file nation.hpp.

◆ client_hints

std::vector<Nation::ClientHint> Nation::client_hints

Definition at line 152 of file nation.hpp.

◆ client_username

std::string Nation::client_username

Definition at line 154 of file nation.hpp.

◆ commodity_production

std::vector<float> Nation::commodity_production

Definition at line 141 of file nation.hpp.

◆ controlled_provinces

std::vector<ProvinceId> Nation::controlled_provinces

Definition at line 149 of file nation.hpp.

◆ current_policy

Policies Nation::current_policy

Definition at line 140 of file nation.hpp.

◆ diplomatic_timer

uint16_t Nation::diplomatic_timer

Definition at line 142 of file nation.hpp.

◆ flags

std::unordered_map<std::string, float> Nation::flags

Definition at line 153 of file nation.hpp.

◆ focus_tech_id

TechnologyId Nation::focus_tech_id

Definition at line 139 of file nation.hpp.

◆ ideology_id

IdeologyId Nation::ideology_id

Definition at line 137 of file nation.hpp.

◆ inbox

std::deque<Event> Nation::inbox

Definition at line 150 of file nation.hpp.

◆ is_puppeted

bool Nation::is_puppeted = false

Definition at line 134 of file nation.hpp.

◆ language_acceptance

std::vector<float> Nation::language_acceptance

Definition at line 145 of file nation.hpp.

◆ name

Eng3D::StringRef Nation::name

Definition at line 125 of file nation.hpp.

◆ owned_provinces

std::vector<ProvinceId> Nation::owned_provinces

Definition at line 148 of file nation.hpp.

◆ prestige

float Nation::prestige = 0.1f

Definition at line 126 of file nation.hpp.

◆ puppet_master_id

NationId Nation::puppet_master_id

Definition at line 135 of file nation.hpp.

◆ religion_discrim

std::vector<float> Nation::religion_discrim

Definition at line 146 of file nation.hpp.

◆ research

std::vector<float> Nation::research

Definition at line 151 of file nation.hpp.

◆ subideology_id

SubideologyId Nation::subideology_id

Definition at line 138 of file nation.hpp.


The documentation for this class was generated from the following files: