aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/map/ProvinceDefinition.cpp
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2024-06-07 00:20:58 +0200
committer hop311 <hop3114@gmail.com>2024-06-07 12:28:16 +0200
commit1198a780916e65cae048dd3478f614c1d18db846 (patch)
treef681dd2e76d489ba6e7beea44ae6ebd59e9d51f3 /src/openvic-simulation/map/ProvinceDefinition.cpp
parentc94a06477fc3930e8f8f2e5f971fc4b5b838ea0d (diff)
Separated MapDefinition and MapInstancemap-instance
Diffstat (limited to 'src/openvic-simulation/map/ProvinceDefinition.cpp')
-rw-r--r--src/openvic-simulation/map/ProvinceDefinition.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/openvic-simulation/map/ProvinceDefinition.cpp b/src/openvic-simulation/map/ProvinceDefinition.cpp
index bb8ad59..c40f8f0 100644
--- a/src/openvic-simulation/map/ProvinceDefinition.cpp
+++ b/src/openvic-simulation/map/ProvinceDefinition.cpp
@@ -2,7 +2,7 @@
#include "openvic-simulation/dataloader/NodeTools.hpp"
#include "openvic-simulation/economy/BuildingType.hpp"
-#include "openvic-simulation/map/Map.hpp"
+#include "openvic-simulation/map/MapDefinition.hpp"
using namespace OpenVic;
using namespace OpenVic::NodeTools;
@@ -26,8 +26,10 @@ std::string ProvinceDefinition::to_string() const {
return stream.str();
}
-bool ProvinceDefinition::load_positions(Map const& map, BuildingTypeManager const& building_type_manager, ast::NodeCPtr root) {
- const fixed_point_t map_height = map.get_height();
+bool ProvinceDefinition::load_positions(
+ MapDefinition const& map_definition, BuildingTypeManager const& building_type_manager, ast::NodeCPtr root
+) {
+ const fixed_point_t map_height = map_definition.get_height();
const bool ret = expect_dictionary_keys(
"text_position", ZERO_OR_ONE,
@@ -70,7 +72,7 @@ bool ProvinceDefinition::load_positions(Map const& map, BuildingTypeManager cons
const fvec2_t port_dir { -rotation.cos(), rotation.sin() };
const ivec2_t port_facing_position = static_cast<ivec2_t>(*port_position + port_dir / 4);
- ProvinceDefinition const* province = map.get_province_definition_at(port_facing_position);
+ ProvinceDefinition const* province = map_definition.get_province_definition_at(port_facing_position);
if (province != nullptr) {
if (province->is_water() && is_adjacent_to(province)) {