From 9dc8c3c89a86b8be2084890f3207adc6c9cda496 Mon Sep 17 00:00:00 2001 From: Hop311 Date: Thu, 14 Sep 2023 08:52:08 +0100 Subject: Move province csv load to SIM + remove return_t --- extension/src/GameSingleton.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'extension/src/GameSingleton.cpp') diff --git a/extension/src/GameSingleton.cpp b/extension/src/GameSingleton.cpp index 6ccde8d..b435f05 100644 --- a/extension/src/GameSingleton.cpp +++ b/extension/src/GameSingleton.cpp @@ -2,7 +2,7 @@ #include -#include "openvic/utility/Logger.hpp" +#include "openvic-simulation/utility/Logger.hpp" #include "Utilities.hpp" @@ -124,10 +124,8 @@ GameSingleton::~GameSingleton() { } Error GameSingleton::setup_game() { - return_t ret = game_manager.setup(); - if (dataloader.load_pop_history(game_manager, "history/pops/" + game_manager.get_today().to_string()) != SUCCESS) { - ret = FAILURE; - } + bool ret = game_manager.setup(); + ret &= dataloader.load_pop_history(game_manager, "history/pops/" + game_manager.get_today().to_string()); return ERR(ret); } @@ -297,7 +295,7 @@ Error GameSingleton::_update_colour_image() { colour_data_array.resize(colour_data_array_size); Error err = OK; - if (game_manager.map.generate_mapmode_colours(mapmode_index, colour_data_array.ptrw()) != SUCCESS) + if (!game_manager.map.generate_mapmode_colours(mapmode_index, colour_data_array.ptrw())) err = FAILED; static constexpr int32_t PROVINCE_INDEX_SQRT = 1 << (sizeof(Province::index_t) * 4); @@ -348,7 +346,7 @@ void GameSingleton::set_selected_province(int32_t index) { } Error GameSingleton::expand_building(int32_t province_index, String const& building_type_identifier) { - if (game_manager.expand_building(province_index, godot_to_std_string(building_type_identifier)) != SUCCESS) { + if (!game_manager.expand_building(province_index, godot_to_std_string(building_type_identifier))) { UtilityFunctions::push_error("Failed to expand ", building_type_identifier, " at province index ", province_index); return FAILED; } -- cgit v1.2.3-56-ga3b1