aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/dataloader/Dataloader.hpp
diff options
context:
space:
mode:
author Steve Frampton <40193522+FarmingtonS9@users.noreply.github.com>2023-09-16 01:15:33 +0200
committer GitHub <noreply@github.com>2023-09-16 01:15:33 +0200
commit879b9debfb97c48ed46d777b2a99d71757658cc6 (patch)
tree87974e84563d08c2f2762b75da0cfb2b4e28eab2 /src/openvic-simulation/dataloader/Dataloader.hpp
parent6278a35f4704574933464700026d8deb997da5c1 (diff)
parent8cf93b6523dc380ef0c7215e15e327a78bf4578e (diff)
Merge pull request #15 from OpenVicProject/more-dataloading
More dataloading
Diffstat (limited to 'src/openvic-simulation/dataloader/Dataloader.hpp')
-rw-r--r--src/openvic-simulation/dataloader/Dataloader.hpp21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/openvic-simulation/dataloader/Dataloader.hpp b/src/openvic-simulation/dataloader/Dataloader.hpp
index efada89..2b358b6 100644
--- a/src/openvic-simulation/dataloader/Dataloader.hpp
+++ b/src/openvic-simulation/dataloader/Dataloader.hpp
@@ -27,13 +27,26 @@ namespace OpenVic {
/* In reverse-load order, so base defines first and final loaded mod last */
bool set_roots(path_vector_t new_roots);
+ /* REQUIREMENTS:
+ * DAT-24
+ */
fs::path lookup_file(fs::path const& path) const;
- static const fs::path TXT;
- path_vector_t lookup_files_in_dir(fs::path const& path, fs::path const* extension = &TXT) const;
- bool apply_to_files_in_dir(fs::path const& path, std::function<bool(fs::path const&)> callback,
- fs::path const* extension = &TXT) 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;
bool load_defines(GameManager& game_manager) const;
bool load_pop_history(GameManager& game_manager, fs::path const& path) const;
+
+ enum locale_t : size_t {
+ English, French, German, Polish, Spanish, Italian, Swedish, Czech, Hungarian, Dutch, Portugese, Russian, Finnish, _LocaleCount
+ };
+ static constexpr char const* locale_names[_LocaleCount] = {
+ "en_GB", "fr_FR", "de_DE", "pl_PL", "es_ES", "it_IT", "sv_SE", "cs_CZ", "hu_HU", "nl_NL", "pt_PT", "ru_RU", "fi_FI"
+ };
+
+ /* Args: key, locale, localisation */
+ using localisation_callback_t = std::function<bool(std::string_view, locale_t, std::string_view)>;
+ bool load_localisation_files(localisation_callback_t callback, fs::path const& localisation_dir = "localisation");
};
}