diff options
author | Hop311 <Hop3114@gmail.com> | 2023-04-18 19:55:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-18 19:55:10 +0200 |
commit | ea077c8a7c78477bd247c7fbd21de13bcf2285e9 (patch) | |
tree | 0cc2be6ef3ab1f2af5c2806f60abe988ca6aa7b5 /extension/src/openvic2/Province.hpp | |
parent | 258a088018d36e987b3ffe4a9b418a6c21ad9217 (diff) | |
parent | 1fdd198f943a41468b03b2cdc62c24147f707239 (diff) |
Merge pull request #88 from OpenVic2Project/map-drawing
Further Map Stuff
Diffstat (limited to 'extension/src/openvic2/Province.hpp')
-rw-r--r-- | extension/src/openvic2/Province.hpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/extension/src/openvic2/Province.hpp b/extension/src/openvic2/Province.hpp new file mode 100644 index 0000000..deebd8c --- /dev/null +++ b/extension/src/openvic2/Province.hpp @@ -0,0 +1,39 @@ +#pragma once + +#include "Types.hpp" + +namespace OpenVic2 { + struct Region; + struct Map; + + /* REQUIREMENTS: + * MAP-5, MAP-8, MAP-43, MAP-47 + */ + struct Province : HasIdentifier { + friend struct Map; + + using colour_t = uint32_t; + using index_t = uint16_t; + using life_rating_t = int8_t; + + static const colour_t NULL_COLOUR = 0, MAX_COLOUR = 0xFFFFFF; + static const index_t NULL_INDEX = 0, MAX_INDEX = 0xFFFF; + private: + index_t index; + colour_t colour; + Region* region = nullptr; + bool water = false; + life_rating_t life_rating = 0; + + Province(index_t new_index, std::string const& new_identifier, colour_t new_colour); + public: + static std::string colour_to_hex_string(colour_t colour); + + index_t get_index() const; + colour_t get_colour() const; + Region* get_region() const; + bool is_water() const; + life_rating_t get_life_rating() const; + std::string to_string() const; + }; +} |