From d3f3187209cb4085f27f95ce8ad2a77af25704fd Mon Sep 17 00:00:00 2001 From: Hop311 Date: Sun, 23 Apr 2023 19:49:01 +0100 Subject: C++ refactoring + simulation prototype --- extension/src/openvic2/Map.hpp | 67 ------------------------------------------ 1 file changed, 67 deletions(-) delete mode 100644 extension/src/openvic2/Map.hpp (limited to 'extension/src/openvic2/Map.hpp') diff --git a/extension/src/openvic2/Map.hpp b/extension/src/openvic2/Map.hpp deleted file mode 100644 index 73ab8fd..0000000 --- a/extension/src/openvic2/Map.hpp +++ /dev/null @@ -1,67 +0,0 @@ -#pragma once - -#include -#include - -#include "Region.hpp" - -namespace OpenVic2 { - - struct Mapmode : HasIdentifier { - friend struct Map; - - using colour_func_t = std::function; - using index_t = size_t; - private: - index_t index; - colour_func_t colour_func; - - Mapmode(index_t new_index, std::string const& new_identifier, colour_func_t new_colour_func); - public: - index_t get_index() const; - colour_func_t get_colour_func() const; - }; - - /* REQUIREMENTS: - * MAP-4 - */ - struct Map { - private: - std::vector provinces; - std::vector regions; - bool provinces_locked = false, water_provinces_locked = false, regions_locked = false; - - size_t width = 0, height = 0; - std::vector province_index_image; - std::vector mapmodes; - public: - return_t add_province(std::string const& identifier, Province::colour_t colour, std::string& error_message); - void lock_provinces(); - return_t set_water_province(std::string const& identifier, std::string& error_message); - void lock_water_provinces(); - return_t add_region(std::string const& identifier, std::vector const& province_identifiers, std::string& error_message); - 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_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; - - Region* get_region_by_identifier(std::string const& identifier); - Region const* get_region_by_identifier(std::string const& identifier) const; - - return_t generate_province_index_image(size_t new_width, size_t new_height, uint8_t const* colour_data, std::string& error_message); - size_t get_width() const; - size_t get_height() const; - std::vector const& get_province_index_image() const; - - return_t add_mapmode(std::string const& identifier, Mapmode::colour_func_t colour_func, std::string& error_message); - size_t get_mapmode_count() const; - Mapmode const* get_mapmode_by_index(Mapmode::index_t index) const; - Mapmode const* get_mapmode_by_identifier(std::string const& identifier) const; - return_t generate_mapmode_colours(Mapmode::index_t index, uint8_t* target, std::string& error_message) const; - }; -} -- cgit v1.2.3-56-ga3b1