From 64bbf86b623a3cca2eaf9009d7acdcde067592e3 Mon Sep 17 00:00:00 2001 From: Hop311 Date: Wed, 3 May 2023 19:37:26 +0100 Subject: Moved code to src/openvic2 --- src/openvic2/map/Province.hpp | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 src/openvic2/map/Province.hpp (limited to 'src/openvic2/map/Province.hpp') diff --git a/src/openvic2/map/Province.hpp b/src/openvic2/map/Province.hpp new file mode 100644 index 0000000..9b07fc1 --- /dev/null +++ b/src/openvic2/map/Province.hpp @@ -0,0 +1,42 @@ +#pragma once + +#include "Building.hpp" + +namespace OpenVic2 { + struct Map; + struct Region; + + /* REQUIREMENTS: + * MAP-5, 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 buildings; + + 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(); + std::vector const& get_buildings() const; + return_t expand_building(std::string const& building_type_identifier); + std::string to_string() const; + + void update_state(Date const& today); + void tick(Date const& today); + }; +} -- cgit v1.2.3-56-ga3b1