diff options
author | zaaarf <zaaarf@proton.me> | 2023-09-19 14:09:19 +0200 |
---|---|---|
committer | zaaarf <zaaarf@proton.me> | 2023-09-19 17:33:15 +0200 |
commit | 3017b6338ca67c0c18f404cf8e162918e36e94e7 (patch) | |
tree | 688d961ebddd6efdf910e90601c0ed5ce2740e48 /src/openvic-simulation/map/Province.hpp | |
parent | 5ece48b0bf738a14a4464d09f29468b9dffdbe05 (diff) |
fix: adjacency algorithm optimisiations and fixes
Diffstat (limited to 'src/openvic-simulation/map/Province.hpp')
-rw-r--r-- | src/openvic-simulation/map/Province.hpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/openvic-simulation/map/Province.hpp b/src/openvic-simulation/map/Province.hpp index 4c89db4..3f75a99 100644 --- a/src/openvic-simulation/map/Province.hpp +++ b/src/openvic-simulation/map/Province.hpp @@ -24,11 +24,11 @@ namespace OpenVic { friend struct Province; private: - index_t province_id; + Province const* province; distance_t distance; flags_t flags; - adjacency_t(index_t provice_id, distance_t distance, flags_t flags); + adjacency_t(Province const* province, distance_t distance, flags_t flags); }; static constexpr index_t NULL_INDEX = 0, MAX_INDEX = (1 << (8 * sizeof(index_t))) - 1; @@ -81,8 +81,8 @@ namespace OpenVic { void update_state(Date const& today); void tick(Date const& today); - bool is_adjacent_to(index_t province_index); - bool add_adjacency(index_t province_index, distance_t distance, flags_t flags); + bool is_adjacent_to(Province const* province); + bool add_adjacency(Province const* province, distance_t distance, flags_t flags); std::vector<adjacency_t> const& get_adjacencies() const; }; } |