Symphony Of Empires
Province Class Reference

A single province, which is used to simulate economy in a "bulk-tiles" way instead of doing economical operations on every single tile. More...

#include <province.hpp>

Inheritance diagram for Province:
Collaboration diagram for Province:

Classes

struct  Battle
 

Public Member Functions

float total_pops () const
 
float average_militancy () const
 
float get_attractiveness (const Pop &pop) const
 
void add_building (const BuildingType &building_type)
 
void cancel_construction_project ()
 
bool is_neighbour (const Province &province) const
 
glm::vec2 get_pos () const
 
float euclidean_distance (const Province &other_province, glm::vec2 world_size, float radius) const
 
const std::vector< Building > & get_buildings () const
 
std::vector< Building > & get_buildings ()
 
bool is_populated () const
 
void unpopulate ()
 
- 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
 
std::uint32_t color = 0
 
bool is_coastal = false
 
float base_attractive = 0.f
 
Eng3D::Rect box_area = Eng3D::Rect(0.f, 0.f, 0.f, 0.f)
 
NationId owner_id
 
NationId controller_id
 
TerrainTypeId terrain_type_id
 
std::vector< uint32_t > rgo_size
 
std::array< Pop, 7 > pops
 
std::vector< Productproducts
 
std::vector< Buildingbuildings
 
struct Province::Battle battle
 
std::vector< NationIdnuclei
 
std::vector< ProvinceIdneighbour_ids
 
std::vector< float > languages
 Percentage of each languages from 0 to 1. More...
 
std::vector< float > religions
 Percentage of each religion prescence on the pops, from 0 to 1. More...
 
- Public Attributes inherited from RefnameEntity< ProvinceId >
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

A single province, which is used to simulate economy in a "bulk-tiles" way instead of doing economical operations on every single tile.

Definition at line 48 of file province.hpp.

Member Function Documentation

◆ add_building()

void Province::add_building ( const BuildingType building_type)

Definition at line 48 of file province.cpp.

◆ average_militancy()

float Province::average_militancy ( ) const
inline

Definition at line 58 of file province.hpp.

◆ cancel_construction_project()

void Province::cancel_construction_project ( )

Definition at line 54 of file province.cpp.

Here is the caller graph for this function:

◆ euclidean_distance()

float Province::euclidean_distance ( const Province other_province,
glm::vec2  world_size,
float  radius 
) const

Definition at line 59 of file province.cpp.

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

◆ get_attractiveness()

float Province::get_attractiveness ( const Pop pop) const

Definition at line 42 of file province.cpp.

◆ get_buildings() [1/2]

std::vector<Building>& Province::get_buildings ( )
inline

Definition at line 80 of file province.hpp.

◆ get_buildings() [2/2]

const std::vector<Building>& Province::get_buildings ( ) const
inline

Definition at line 76 of file province.hpp.

◆ get_pos()

glm::vec2 Province::get_pos ( ) const
inline

Definition at line 70 of file province.hpp.

Here is the caller graph for this function:

◆ is_neighbour()

bool Province::is_neighbour ( const Province province) const

Definition at line 68 of file province.cpp.

◆ is_populated()

bool Province::is_populated ( ) const
inline

Definition at line 84 of file province.hpp.

Here is the caller graph for this function:

◆ total_pops()

float Province::total_pops ( ) const
inline

Definition at line 51 of file province.hpp.

Here is the caller graph for this function:

◆ unpopulate()

void Province::unpopulate ( )
inline

Definition at line 91 of file province.hpp.

Member Data Documentation

◆ base_attractive

float Province::base_attractive = 0.f

Definition at line 99 of file province.hpp.

◆ battle

struct Province::Battle Province::battle

◆ box_area

Eng3D::Rect Province::box_area = Eng3D::Rect(0.f, 0.f, 0.f, 0.f)

Definition at line 102 of file province.hpp.

◆ buildings

std::vector<Building> Province::buildings

Definition at line 110 of file province.hpp.

◆ color

std::uint32_t Province::color = 0

Definition at line 97 of file province.hpp.

◆ controller_id

NationId Province::controller_id

Definition at line 104 of file province.hpp.

◆ is_coastal

bool Province::is_coastal = false

Definition at line 98 of file province.hpp.

◆ languages

std::vector<float> Province::languages

Percentage of each languages from 0 to 1.

Definition at line 126 of file province.hpp.

◆ name

Eng3D::StringRef Province::name

Definition at line 96 of file province.hpp.

◆ neighbour_ids

std::vector<ProvinceId> Province::neighbour_ids

Definition at line 124 of file province.hpp.

◆ nuclei

std::vector<NationId> Province::nuclei

Definition at line 123 of file province.hpp.

◆ owner_id

NationId Province::owner_id

Definition at line 103 of file province.hpp.

◆ pops

std::array<Pop, 7> Province::pops

Definition at line 107 of file province.hpp.

◆ products

std::vector<Product> Province::products

Definition at line 109 of file province.hpp.

◆ religions

std::vector<float> Province::religions

Percentage of each religion prescence on the pops, from 0 to 1.

Definition at line 128 of file province.hpp.

◆ rgo_size

std::vector<uint32_t> Province::rgo_size

Definition at line 106 of file province.hpp.

◆ terrain_type_id

TerrainTypeId Province::terrain_type_id

Definition at line 105 of file province.hpp.


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