diff options
author | CptAlanSmith <123112708+CptAlanSmith@users.noreply.github.com> | 2023-09-25 23:21:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-25 23:21:59 +0200 |
commit | 63e462fceff981f79bcbae53e8d90fc59733e8c2 (patch) | |
tree | 403b586b3bc3f69f42a2362a273e77415ebf1d22 /src/openvic-simulation/map/Province.hpp | |
parent | 127ca294056817bc5814ef5516b29a67ff3fa3bb (diff) | |
parent | 932b43953d623557236a31b30899b706307260ed (diff) |
Merge pull request #33 from OpenVicProject/terrain-types
Terrain types
Diffstat (limited to 'src/openvic-simulation/map/Province.hpp')
-rw-r--r-- | src/openvic-simulation/map/Province.hpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/openvic-simulation/map/Province.hpp b/src/openvic-simulation/map/Province.hpp index 0a4aa46..6e4ac7e 100644 --- a/src/openvic-simulation/map/Province.hpp +++ b/src/openvic-simulation/map/Province.hpp @@ -1,5 +1,7 @@ #pragma once +#include <limits> + #include "openvic-simulation/map/Building.hpp" #include "openvic-simulation/pop/Pop.hpp" @@ -7,6 +9,8 @@ namespace OpenVic { struct Map; struct Region; struct Good; + struct TerrainType; + struct TerrainTypeMapping; /* REQUIREMENTS: * MAP-5, MAP-7, MAP-8, MAP-43, MAP-47 @@ -32,10 +36,10 @@ namespace OpenVic { public: distance_t get_distance() const; - flags_t get_flags(); + flags_t get_flags() const; }; - static constexpr index_t NULL_INDEX = 0, MAX_INDEX = (1 << (8 * sizeof(index_t))) - 1; + static constexpr index_t NULL_INDEX = 0, MAX_INDEX = std::numeric_limits<index_t>::max(); private: const index_t index; @@ -52,6 +56,10 @@ namespace OpenVic { std::vector<adjacency_t> adjacencies; + TerrainType const* terrain_type = nullptr; + + void _set_terrain_type(TerrainType const* type); + Province(const std::string_view new_identifier, colour_t new_colour, index_t new_index); public: @@ -61,6 +69,7 @@ namespace OpenVic { Region* get_region() const; bool get_has_region() const; bool get_water() const; + TerrainType const* get_terrain_type() const; life_rating_t get_life_rating() const; bool load_positions(BuildingManager const& building_manager, ast::NodeCPtr root); |