aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/dataloader/Dataloader.hpp
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2023-09-19 17:40:09 +0200
committer GitHub <noreply@github.com>2023-09-19 17:40:09 +0200
commit9c89100e0c8854dff3174b078d235148585a8b03 (patch)
tree77f81dfd3ec85a659741e979c148b33b22595dd0 /src/openvic-simulation/dataloader/Dataloader.hpp
parent64d134ad20c333afa60373526d6fab27a07c6adc (diff)
parent72add97c47f0d17fc0019bb4cfec7506740a9c7d (diff)
Merge pull request #17 from OpenVicProject/dataloading-the-third
Scaffolding for `positions.txt` + modifier loading
Diffstat (limited to 'src/openvic-simulation/dataloader/Dataloader.hpp')
-rw-r--r--src/openvic-simulation/dataloader/Dataloader.hpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/openvic-simulation/dataloader/Dataloader.hpp b/src/openvic-simulation/dataloader/Dataloader.hpp
index 2b358b6..6741361 100644
--- a/src/openvic-simulation/dataloader/Dataloader.hpp
+++ b/src/openvic-simulation/dataloader/Dataloader.hpp
@@ -4,6 +4,8 @@
#include <functional>
#include <vector>
+#include "openvic-simulation/dataloader/NodeTools.hpp"
+
namespace OpenVic {
namespace fs = std::filesystem;
@@ -19,7 +21,7 @@ namespace OpenVic {
path_vector_t roots;
bool _load_pop_types(PopManager& pop_manager, fs::path const& pop_type_directory) const;
- bool _load_map_dir(Map& map, fs::path const& map_directory) const;
+ bool _load_map_dir(GameManager& game_manager, fs::path const& map_directory) const;
public:
Dataloader() = default;
@@ -33,7 +35,7 @@ namespace OpenVic {
fs::path lookup_file(fs::path const& path) const;
path_vector_t lookup_files_in_dir(fs::path const& path, fs::path const& extension) const;
bool apply_to_files_in_dir(fs::path const& path, fs::path const& extension,
- std::function<bool(fs::path const&)> callback) const;
+ NodeTools::callback_t<fs::path const&> callback) const;
bool load_defines(GameManager& game_manager) const;
bool load_pop_history(GameManager& game_manager, fs::path const& path) const;
@@ -46,7 +48,7 @@ namespace OpenVic {
};
/* Args: key, locale, localisation */
- using localisation_callback_t = std::function<bool(std::string_view, locale_t, std::string_view)>;
+ using localisation_callback_t = NodeTools::callback_t<std::string_view, locale_t, std::string_view>;
bool load_localisation_files(localisation_callback_t callback, fs::path const& localisation_dir = "localisation");
};
}