aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic2/map/Map.hpp
diff options
context:
space:
mode:
author ClarkeCode <33846391+ClarkeCode@users.noreply.github.com>2023-04-29 03:39:28 +0200
committer GitHub <noreply@github.com>2023-04-29 03:39:28 +0200
commit1f8545facd248bbf4ea0cd551fea5f7d9b0efdce (patch)
tree0accf6d2c5479afb99649351ccf485b63520ac81 /extension/src/openvic2/map/Map.hpp
parent05937359e8c53ee76dc3ce537dd70083a016f766 (diff)
parentef0d15bef9c35f261c4d09bbb23a2b8731acd3fc (diff)
Merge pull request #100 from OpenVic2Project/goods
Addition of goods struct
Diffstat (limited to 'extension/src/openvic2/map/Map.hpp')
-rw-r--r--extension/src/openvic2/map/Map.hpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/extension/src/openvic2/map/Map.hpp b/extension/src/openvic2/map/Map.hpp
index dea9b29..e5be9c7 100644
--- a/extension/src/openvic2/map/Map.hpp
+++ b/extension/src/openvic2/map/Map.hpp
@@ -3,13 +3,14 @@
#include <functional>
#include "openvic2/map/Region.hpp"
+#include "openvic2/Types.hpp"
namespace OpenVic2 {
struct Mapmode : HasIdentifier {
friend struct Map;
- using colour_func_t = std::function<Province::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;
@@ -18,7 +19,7 @@ namespace OpenVic2 {
Mapmode(index_t new_index, std::string const& new_identifier, colour_func_t new_colour_func);
public:
index_t get_index() const;
- Province::colour_t get_colour(Map const& map, Province const& province) const;
+ colour_t get_colour(Map const& map, Province const& province) const;
};
/* REQUIREMENTS:
@@ -27,7 +28,7 @@ namespace OpenVic2 {
struct Map {
#pragma pack(push, 1)
struct shape_pixel_t {
- Province::index_t index;
+ index_t index;
uint8_t terrain;
};
#pragma pack(pop)
@@ -43,7 +44,7 @@ namespace OpenVic2 {
public:
Map();
- return_t add_province(std::string const& identifier, Province::colour_t colour);
+ return_t add_province(std::string const& identifier, colour_t colour);
void lock_provinces();
return_t set_water_province(std::string const& identifier);
void lock_water_provinces();
@@ -51,13 +52,13 @@ namespace OpenVic2 {
void lock_regions();
size_t get_province_count() const;
- Province* get_province_by_index(Province::index_t index);
- Province const* get_province_by_index(Province::index_t index) const;
+ Province* get_province_by_index(index_t index);
+ Province const* get_province_by_index(index_t index) const;
Province* get_province_by_identifier(std::string const& identifier);
Province const* get_province_by_identifier(std::string const& identifier) const;
- Province* get_province_by_colour(Province::colour_t colour);
- Province const* get_province_by_colour(Province::colour_t colour) const;
- Province::index_t get_province_index_at(size_t x, size_t y) const;
+ Province* get_province_by_colour(colour_t colour);
+ Province const* get_province_by_colour(colour_t colour) const;
+ index_t get_province_index_at(size_t x, size_t y) const;
Region* get_region_by_identifier(std::string const& identifier);
Region const* get_region_by_identifier(std::string const& identifier) const;