aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/map/Province.hpp
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2023-11-07 22:38:07 +0100
committer GitHub <noreply@github.com>2023-11-07 22:38:07 +0100
commitae2742113ec7283a2a5afa62f8bfd98a865c4208 (patch)
tree601591215af0c6724766019ebb577141ea5807c5 /src/openvic-simulation/map/Province.hpp
parent1603fbafb1c03830f38fefd87d8bd0d7d3f135a2 (diff)
parentd30421fa7d7f6ad87d3f90cc0ab491742f0d2548 (diff)
Merge pull request #64 from OpenVicProject/modifier-instance
ModifierEffects stored as instances
Diffstat (limited to 'src/openvic-simulation/map/Province.hpp')
-rw-r--r--src/openvic-simulation/map/Province.hpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/openvic-simulation/map/Province.hpp b/src/openvic-simulation/map/Province.hpp
index 2704354..2fd15c9 100644
--- a/src/openvic-simulation/map/Province.hpp
+++ b/src/openvic-simulation/map/Province.hpp
@@ -3,6 +3,7 @@
#include <cassert>
#include "openvic-simulation/economy/Building.hpp"
+#include "openvic-simulation/politics/Ideology.hpp"
#include "openvic-simulation/pop/Pop.hpp"
namespace OpenVic {
@@ -24,6 +25,8 @@ namespace OpenVic {
using distance_t = uint16_t;
using flags_t = uint16_t;
+ enum struct colony_status_t : int8_t { STATE, PROTECTORATE, COLONY };
+
struct adjacency_t {
friend struct Province;
@@ -63,13 +66,17 @@ namespace OpenVic {
Region* region = nullptr;
bool on_map = false, has_region = false, water = false;
life_rating_t life_rating = 0;
+ colony_status_t colony_status = colony_status_t::STATE;
IdentifierRegistry<BuildingInstance> buildings;
// TODO - change this into a factory-like structure
Good const* rgo = nullptr;
std::vector<Pop> pops;
Pop::pop_size_t total_population;
- distribution_t pop_types, cultures, religions;
+ decimal_map_t<PopType const*> PROPERTY(pop_type_distribution);
+ decimal_map_t<Ideology const*> PROPERTY(ideology_distribution);
+ decimal_map_t<Culture const*> PROPERTY(culture_distribution);
+ decimal_map_t<Religion const*> PROPERTY(religion_distribution);
std::vector<adjacency_t> adjacencies;
province_positions_t positions;
@@ -90,6 +97,7 @@ namespace OpenVic {
bool get_water() const;
TerrainType const* get_terrain_type() const;
life_rating_t get_life_rating() const;
+ colony_status_t get_colony_status() const;
bool load_positions(BuildingManager const& building_manager, ast::NodeCPtr root);
bool add_building(BuildingInstance&& building_instance);
@@ -105,13 +113,10 @@ namespace OpenVic {
size_t get_pop_count() const;
std::vector<Pop> const& get_pops() const;
Pop::pop_size_t get_total_population() const;
- distribution_t const& get_pop_type_distribution() const;
- distribution_t const& get_culture_distribution() const;
- distribution_t const& get_religion_distribution() const;
void update_pops();
- void update_state(Date const& today);
- void tick(Date const& today);
+ void update_state(Date today);
+ void tick(Date today);
bool is_adjacent_to(Province const* province);
bool add_adjacency(Province const* province, distance_t distance, flags_t flags);