aboutsummaryrefslogtreecommitdiff
path: root/src/openvic/map/Map.hpp
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2023-05-22 17:54:15 +0200
committer GitHub <noreply@github.com>2023-05-22 17:54:15 +0200
commit08ec6fe5fbf52d814d88c235aac84bb95ad4e322 (patch)
tree136a221eb5e7c895c8219778b3d206f2ed9e8e7f /src/openvic/map/Map.hpp
parent15e960f93ced8c94a6a45ebb2b44d0705ff7f8f6 (diff)
parent7874702f30d5855319faf197b10aed31f07f5e27 (diff)
Merge pull request #5 from OpenVicProject/bmp
BMP palette parser + code style cleanup
Diffstat (limited to 'src/openvic/map/Map.hpp')
-rw-r--r--src/openvic/map/Map.hpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/openvic/map/Map.hpp b/src/openvic/map/Map.hpp
index 39c37c0..3533a14 100644
--- a/src/openvic/map/Map.hpp
+++ b/src/openvic/map/Map.hpp
@@ -9,14 +9,18 @@ namespace OpenVic {
struct Mapmode : HasIdentifier {
friend struct Map;
- using colour_func_t = std::function<colour_t (Map const&, Province const&)>;
+ using colour_func_t = std::function<colour_t(Map const&, Province const&)>;
using index_t = size_t;
+
private:
const index_t index;
const colour_func_t colour_func;
Mapmode(index_t new_index, std::string const& new_identifier, colour_func_t new_colour_func);
+
public:
+ static const Mapmode ERROR_MAPMODE;
+
index_t get_index() const;
colour_t get_colour(Map const& map, Province const& province) const;
};
@@ -30,12 +34,12 @@ namespace OpenVic {
using terrain_t = uint8_t;
using terrain_variant_map_t = std::map<colour_t, terrain_t>;
- #pragma pack(push, 1)
+#pragma pack(push, 1)
struct shape_pixel_t {
index_t index;
terrain_t terrain;
};
- #pragma pack(pop)
+#pragma pack(pop)
private:
using colour_index_map_t = std::map<colour_t, index_t>;
@@ -51,6 +55,7 @@ namespace OpenVic {
index_t selected_province = NULL_INDEX;
index_t get_index_from_colour(colour_t colour) const;
+
public:
Map();