aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic-extension/classes/GFXMaskedFlagTexture.cpp
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2024-07-04 17:33:40 +0200
committer GitHub <noreply@github.com>2024-07-04 17:33:40 +0200
commit88dd4ab93ca80cd677528e15043e8b6121c05562 (patch)
tree2933b65a98ef0a4b32c4bd848ecdad574bc1cfde /extension/src/openvic-extension/classes/GFXMaskedFlagTexture.cpp
parent6797e64ce8179635d56b73b5b4783eca560cbf11 (diff)
parent99a85d03de5297f2c7c29aedfc83e4e37cbc795b (diff)
Merge pull request #236 from OpenVicProject/country-definition
Use CountryDefinition and CountryInstance
Diffstat (limited to 'extension/src/openvic-extension/classes/GFXMaskedFlagTexture.cpp')
-rw-r--r--extension/src/openvic-extension/classes/GFXMaskedFlagTexture.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/extension/src/openvic-extension/classes/GFXMaskedFlagTexture.cpp b/extension/src/openvic-extension/classes/GFXMaskedFlagTexture.cpp
index fdc1a10..c17fa0e 100644
--- a/extension/src/openvic-extension/classes/GFXMaskedFlagTexture.cpp
+++ b/extension/src/openvic-extension/classes/GFXMaskedFlagTexture.cpp
@@ -162,7 +162,9 @@ String GFXMaskedFlagTexture::get_gfx_masked_flag_name() const {
return gfx_masked_flag != nullptr ? std_view_to_godot_string(gfx_masked_flag->get_name()) : String {};
}
-Error GFXMaskedFlagTexture::set_flag_country_and_type(Country const* new_flag_country, StringName const& new_flag_type) {
+Error GFXMaskedFlagTexture::set_flag_country_and_type(
+ CountryDefinition const* new_flag_country, StringName const& new_flag_type
+) {
if (flag_country == new_flag_country && flag_type == new_flag_type) {
return OK;
}
@@ -193,14 +195,15 @@ Error GFXMaskedFlagTexture::set_flag_country_name_and_type(
}
GameSingleton* game_singleton = GameSingleton::get_singleton();
ERR_FAIL_NULL_V(game_singleton, FAILED);
- Country const* new_flag_country = game_singleton->get_definition_manager().get_country_manager().get_country_by_identifier(
- godot_to_std_string(new_flag_country_name)
- );
+ CountryDefinition const* new_flag_country =
+ game_singleton->get_definition_manager().get_country_definition_manager().get_country_definition_by_identifier(
+ godot_to_std_string(new_flag_country_name)
+ );
ERR_FAIL_NULL_V_MSG(new_flag_country, FAILED, vformat("Country not found: %s", new_flag_country_name));
return set_flag_country_and_type(new_flag_country, new_flag_type);
}
-Error GFXMaskedFlagTexture::set_flag_country(Country const* new_flag_country) {
+Error GFXMaskedFlagTexture::set_flag_country(CountryDefinition const* new_flag_country) {
// TODO - get country's current flag type from the game state
return set_flag_country_and_type( new_flag_country, {});
}
@@ -211,9 +214,10 @@ Error GFXMaskedFlagTexture::set_flag_country_name(String const& new_flag_country
}
GameSingleton* game_singleton = GameSingleton::get_singleton();
ERR_FAIL_NULL_V(game_singleton, FAILED);
- Country const* new_flag_country = game_singleton->get_definition_manager().get_country_manager().get_country_by_identifier(
- godot_to_std_string(new_flag_country_name)
- );
+ CountryDefinition const* new_flag_country =
+ game_singleton->get_definition_manager().get_country_definition_manager().get_country_definition_by_identifier(
+ godot_to_std_string(new_flag_country_name)
+ );
ERR_FAIL_NULL_V_MSG(new_flag_country, FAILED, vformat("Country not found: %s", new_flag_country_name));
return set_flag_country(new_flag_country);
}