From ee9562c767631fbec6b444cf18f2435d24848e93 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Mon, 20 Nov 2023 01:23:08 -0600 Subject: Additional adjacency loading --- src/openvic-simulation/map/Map.hpp | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'src/openvic-simulation/map/Map.hpp') diff --git a/src/openvic-simulation/map/Map.hpp b/src/openvic-simulation/map/Map.hpp index 16d12a8..185e99e 100644 --- a/src/openvic-simulation/map/Map.hpp +++ b/src/openvic-simulation/map/Map.hpp @@ -59,20 +59,24 @@ namespace OpenVic { ProvinceSet water_provinces; TerrainTypeManager PROPERTY_REF(terrain_type_manager); - size_t width = 0, height = 0; - std::vector province_shape_image; + int32_t PROPERTY(width); + int32_t PROPERTY(height); + std::vector PROPERTY(province_shape_image); colour_index_map_t colour_index_map; - Province::index_t max_provinces = Province::MAX_INDEX; - Province::index_t selected_province = Province::NULL_INDEX; - Pop::pop_size_t highest_province_population, total_map_population; + Province::index_t PROPERTY(max_provinces); + Province::index_t PROPERTY(selected_province_index); + Pop::pop_size_t PROPERTY(highest_province_population) + Pop::pop_size_t PROPERTY(total_map_population); Province::index_t get_index_from_colour(colour_t colour) const; - bool _generate_province_adjacencies(); + bool _generate_standard_province_adjacencies(); StateManager PROPERTY_REF(state_manager); public: + Map(); + bool add_province(std::string_view identifier, colour_t colour); IDENTIFIER_REGISTRY_NON_CONST_ACCESSORS_CUSTOM_INDEX_OFFSET(province, 1); @@ -82,15 +86,9 @@ namespace OpenVic { Province::index_t get_province_index_at(size_t x, size_t y) const; bool set_max_provinces(Province::index_t new_max_provinces); - Province::index_t get_max_provinces() const; void set_selected_province(Province::index_t index); - Province::index_t get_selected_province_index() const; Province const* get_selected_province() const; - size_t get_width() const; - size_t get_height() const; - std::vector const& get_province_shape_image() const; - bool add_region(std::string_view identifier, std::vector const& province_identifiers); IDENTIFIER_REGISTRY_NON_CONST_ACCESSORS(region) @@ -107,14 +105,13 @@ namespace OpenVic { bool apply_history_to_provinces(ProvinceHistoryManager const& history_manager, Date date); void update_highest_province_population(); - Pop::pop_size_t get_highest_province_population() const; void update_total_map_population(); - Pop::pop_size_t get_total_map_population() const; void update_state(Date today); void tick(Date today); bool load_province_definitions(std::vector const& lines); + /* Must be loaded after adjacencies so we know what provinces are coastal, and so can have a port */ bool load_province_positions(BuildingTypeManager const& building_type_manager, ast::NodeCPtr root); bool load_region_file(ast::NodeCPtr root); bool load_map_images(fs::path const& province_path, fs::path const& terrain_path, bool detailed_errors); -- cgit v1.2.3-56-ga3b1