aboutsummaryrefslogtreecommitdiff
path: root/src/openvic/map/Province.hpp
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2023-05-16 21:25:14 +0200
committer GitHub <noreply@github.com>2023-05-16 21:25:14 +0200
commitcedac2d020ae7e54d8fc5c21e390a306050bc220 (patch)
tree440634772615531e704a5554aa59c9890cd9cd85 /src/openvic/map/Province.hpp
parent339e0278a2064f7eeb152fe8c5778840b609e9f3 (diff)
parent42d9d1d5417deb5979a9d5775cfe97dcff4b77ba (diff)
Merge pull request #3 from OpenVicProject/openvic-rename
Changed from OpenVic2 to OpenVic
Diffstat (limited to 'src/openvic/map/Province.hpp')
-rw-r--r--src/openvic/map/Province.hpp47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/openvic/map/Province.hpp b/src/openvic/map/Province.hpp
new file mode 100644
index 0000000..cc11046
--- /dev/null
+++ b/src/openvic/map/Province.hpp
@@ -0,0 +1,47 @@
+#pragma once
+
+#include "Building.hpp"
+
+namespace OpenVic {
+ struct Map;
+ struct Region;
+ struct Good;
+
+ /* REQUIREMENTS:
+ * MAP-5, MAP-7, MAP-8, MAP-43, MAP-47
+ */
+ struct Province : HasIdentifier, HasColour {
+ friend struct Map;
+
+ using life_rating_t = int8_t;
+
+ private:
+ const index_t index;
+ Region* region = nullptr;
+ bool water = false;
+ life_rating_t life_rating = 0;
+ IdentifierRegistry<Building> buildings;
+ // TODO - change this into a factory-like structure
+ Good const* rgo = nullptr;
+
+ Province(index_t new_index, std::string const& new_identifier, colour_t new_colour);
+ public:
+ Province(Province&&) = default;
+
+ index_t get_index() const;
+ Region* get_region() const;
+ bool is_water() const;
+ life_rating_t get_life_rating() const;
+ return_t add_building(BuildingType const& type);
+ void lock_buildings();
+ void reset_buildings();
+ Building const* get_building_by_identifier(std::string const& identifier) const;
+ std::vector<Building> const& get_buildings() const;
+ return_t expand_building(std::string const& building_type_identifier);
+ Good const* get_rgo() const;
+ std::string to_string() const;
+
+ void update_state(Date const& today);
+ void tick(Date const& today);
+ };
+}