diff options
author | Hop311 <hop3114@gmail.com> | 2023-09-18 01:16:05 +0200 |
---|---|---|
committer | Hop311 <hop3114@gmail.com> | 2023-09-18 01:16:05 +0200 |
commit | 72add97c47f0d17fc0019bb4cfec7506740a9c7d (patch) | |
tree | 77f81dfd3ec85a659741e979c148b33b22595dd0 /src/openvic-simulation/dataloader | |
parent | 5549753a6ae909b1a65f52a1cc67ef2b5efae55a (diff) |
Province adjacency scaffolding
Diffstat (limited to 'src/openvic-simulation/dataloader')
-rw-r--r-- | src/openvic-simulation/dataloader/Dataloader.cpp | 4 | ||||
-rw-r--r-- | src/openvic-simulation/dataloader/NodeTools.hpp | 8 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/openvic-simulation/dataloader/Dataloader.cpp b/src/openvic-simulation/dataloader/Dataloader.cpp index 2d2f59f..a30983b 100644 --- a/src/openvic-simulation/dataloader/Dataloader.cpp +++ b/src/openvic-simulation/dataloader/Dataloader.cpp @@ -252,7 +252,7 @@ bool Dataloader::_load_map_dir(GameManager& game_manager, fs::path const& map_di } bool Dataloader::load_defines(GameManager& game_manager) const { - static const fs::path good_file = "common/goods.txt"; + static const fs::path goods_file = "common/goods.txt"; static const fs::path pop_type_directory = "poptypes"; static const fs::path graphical_culture_type_file = "common/graphicalculturetype.txt"; static const fs::path culture_file = "common/cultures.txt"; @@ -261,7 +261,7 @@ bool Dataloader::load_defines(GameManager& game_manager) const { bool ret = true; - if (!game_manager.good_manager.load_good_file(_parse_defines(lookup_file(good_file)).get_file_node())) { + if (!game_manager.good_manager.load_goods_file(_parse_defines(lookup_file(goods_file)).get_file_node())) { Logger::error("Failed to load goods!"); ret = false; } diff --git a/src/openvic-simulation/dataloader/NodeTools.hpp b/src/openvic-simulation/dataloader/NodeTools.hpp index bb75ffe..51bbfa9 100644 --- a/src/openvic-simulation/dataloader/NodeTools.hpp +++ b/src/openvic-simulation/dataloader/NodeTools.hpp @@ -162,5 +162,13 @@ namespace OpenVic { callback_t<int64_t> assign_variable_callback_int(const std::string_view name, T& var) { return _assign_variable_callback_int<int64_t>(name, var); } + + template<typename T> + callback_t<T const&> assign_variable_callback_pointer(T const*& var) { + return [&var](T const& val) -> bool { + var = &val; + return true; + }; + } } } |