From c7eac74bb550c28be9eb75742f25d974b7742634 Mon Sep 17 00:00:00 2001 From: Joel Machens Date: Mon, 2 Oct 2023 21:27:51 -0500 Subject: Initial Government Type Loading --- src/openvic-simulation/dataloader/Dataloader.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/openvic-simulation/dataloader/Dataloader.cpp') diff --git a/src/openvic-simulation/dataloader/Dataloader.cpp b/src/openvic-simulation/dataloader/Dataloader.cpp index 4a98bca..b4b23aa 100644 --- a/src/openvic-simulation/dataloader/Dataloader.cpp +++ b/src/openvic-simulation/dataloader/Dataloader.cpp @@ -274,17 +274,19 @@ 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 goods_file = "common/goods.txt"; + static const fs::path map_directory = "map"; static const fs::path pop_type_directory = "poptypes"; - static const fs::path graphical_culture_type_file = "common/graphicalculturetype.txt"; + static const fs::path units_directory = "units"; + + static const fs::path buildings_file = "common/buildings.txt"; static const fs::path culture_file = "common/cultures.txt"; - static const fs::path religion_file = "common/religion.txt"; + static const fs::path goods_file = "common/goods.txt"; + static const fs::path governments_file = "common/governments.txt"; + static const fs::path graphical_culture_type_file = "common/graphicalculturetype.txt"; static const fs::path ideology_file = "common/ideologies.txt"; static const fs::path issues_file = "common/issues.txt"; static const fs::path production_types_file = "common/production_types.txt"; - static const fs::path buildings_file = "common/buildings.txt"; - static const fs::path map_directory = "map"; - static const fs::path units_directory = "units"; + static const fs::path religion_file = "common/religion.txt"; bool ret = true; @@ -316,6 +318,10 @@ bool Dataloader::load_defines(GameManager& game_manager) const { Logger::error("Failed to load ideologies!"); ret = false; } + if (!game_manager.get_government_type_manager().load_government_types_file(_parse_defines(lookup_file(governments_file)).get_file_node())) { + Logger::error("Failed to load government types!"); + ret = false; + } if (!game_manager.get_issue_manager().load_issues_file(_parse_defines(lookup_file(issues_file)).get_file_node())) { Logger::error("Failed to load issues!"); ret = false; -- cgit v1.2.3-56-ga3b1