diff options
author | zaaarf <me@zaaarf.foo> | 2024-01-02 15:24:06 +0100 |
---|---|---|
committer | zaaarf <me@zaaarf.foo> | 2024-01-02 15:24:06 +0100 |
commit | 2f5706fd5ef6bbdee54c82860e03f00a96751693 (patch) | |
tree | 18f411de9d9017c6e8b1f5251c7cc02abdecde90 /src/openvic-simulation/map/Map.hpp | |
parent | 255f85c12d104f7f7b12bd69892a1c993885451d (diff) |
feat: calculate province distance using new sqrt functions
Diffstat (limited to 'src/openvic-simulation/map/Map.hpp')
-rw-r--r-- | src/openvic-simulation/map/Map.hpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/openvic-simulation/map/Map.hpp b/src/openvic-simulation/map/Map.hpp index 3e7ff35..393f8d3 100644 --- a/src/openvic-simulation/map/Map.hpp +++ b/src/openvic-simulation/map/Map.hpp @@ -5,6 +5,7 @@ #include <openvic-dataloader/csv/LineObject.hpp> +#include "openvic-simulation/map/Province.hpp" #include "openvic-simulation/map/Region.hpp" #include "openvic-simulation/map/State.hpp" #include "openvic-simulation/map/TerrainType.hpp" @@ -89,6 +90,13 @@ namespace OpenVic { bool add_province(std::string_view identifier, colour_t colour); IDENTIFIER_REGISTRY_NON_CONST_ACCESSORS_CUSTOM_INDEX_OFFSET(province, 1); + Province::distance_t calculate_distance_between(Province const& from, Province const& to) const; + bool add_standard_adjacency(Province& from, Province& to) const; + bool add_special_adjacency( + Province& from, Province& to, Province::adjacency_t::type_t type, Province const* through, + Province::adjacency_t::data_t data + ) const; + /* This provides a safe way to remove the const qualifier of a Province const*, via a non-const Map. * It uses a const_cast (the fastest/simplest solution), but this could also be done without it by looking up the * Province* using the Province const*'s index. Requiring a non-const Map ensures that this function can only be |