aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic2/map/Province.hpp
diff options
context:
space:
mode:
author ClarkeCode <clarke.john.robert@gmail.com>2023-04-28 23:34:45 +0200
committer ClarkeCode <clarke.john.robert@gmail.com>2023-04-28 23:34:45 +0200
commit1b35c3a4434873b98f8e3aa7770f0edd37ec053c (patch)
treed15169c42d04a09d6d1d74593fe21458cdb9f6df /extension/src/openvic2/map/Province.hpp
parent92d0f35b989b0164e2dd8c9a32213c6038e5d57f (diff)
Moved several type aliases to Types.hpp; Added HasColour class for items which need associated colours
Diffstat (limited to 'extension/src/openvic2/map/Province.hpp')
-rw-r--r--extension/src/openvic2/map/Province.hpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/extension/src/openvic2/map/Province.hpp b/extension/src/openvic2/map/Province.hpp
index aa0329c..65eaa09 100644
--- a/extension/src/openvic2/map/Province.hpp
+++ b/extension/src/openvic2/map/Province.hpp
@@ -1,6 +1,7 @@
#pragma once
#include "openvic2/map/Building.hpp"
+#include "openvic2/Types.hpp"
namespace OpenVic2 {
struct Map;
@@ -9,18 +10,13 @@ namespace OpenVic2 {
/* REQUIREMENTS:
* MAP-5, MAP-8, MAP-43, MAP-47
*/
- struct Province : HasIdentifier {
+ struct Province : HasIdentifier, HasColour {
friend struct Map;
- using colour_t = uint32_t;
- using index_t = uint16_t;
using life_rating_t = int8_t;
- static constexpr colour_t NULL_COLOUR = 0, MAX_COLOUR = 0xFFFFFF;
- static constexpr index_t NULL_INDEX = 0, MAX_INDEX = 0xFFFF;
private:
const index_t index;
- const colour_t colour;
Region* region = nullptr;
bool water = false;
life_rating_t life_rating = 0;
@@ -28,12 +24,9 @@ namespace OpenVic2 {
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);
-
Province(Province&&) = default;
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;