aboutsummaryrefslogtreecommitdiff
path: root/extension/src/GameSingleton.cpp
diff options
context:
space:
mode:
author Hop311 <hop3114@gmail.com>2023-09-14 09:52:08 +0200
committer Hop311 <hop3114@gmail.com>2023-09-14 09:52:08 +0200
commit9dc8c3c89a86b8be2084890f3207adc6c9cda496 (patch)
treeaf5fcc9e7122813446318957a66da940d09b6f36 /extension/src/GameSingleton.cpp
parentc715187bffa8c84428acf3631e3d03c088a719d9 (diff)
Move province csv load to SIM + remove return_t
Diffstat (limited to 'extension/src/GameSingleton.cpp')
-rw-r--r--extension/src/GameSingleton.cpp12
1 files changed, 5 insertions, 7 deletions
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 <godot_cpp/variant/utility_functions.hpp>
-#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;
}