aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/country
diff options
context:
space:
mode:
Diffstat (limited to 'src/openvic-simulation/country')
-rw-r--r--src/openvic-simulation/country/CountryInstance.cpp3
-rw-r--r--src/openvic-simulation/country/CountryInstance.hpp5
2 files changed, 8 insertions, 0 deletions
diff --git a/src/openvic-simulation/country/CountryInstance.cpp b/src/openvic-simulation/country/CountryInstance.cpp
index 5313af4..e2d5cc7 100644
--- a/src/openvic-simulation/country/CountryInstance.cpp
+++ b/src/openvic-simulation/country/CountryInstance.cpp
@@ -231,6 +231,9 @@ bool CountryInstance::has_country_flag(std::string_view flag) const {
return false; \
} \
return true; \
+ } \
+ bool CountryInstance::has_##item(std::remove_pointer_t<decltype(item##s)::value_type> const& item) const { \
+ return item##s.contains(&item); \
}
ADD_AND_REMOVE(owned_province)
diff --git a/src/openvic-simulation/country/CountryInstance.hpp b/src/openvic-simulation/country/CountryInstance.hpp
index 297f928..ca47b89 100644
--- a/src/openvic-simulation/country/CountryInstance.hpp
+++ b/src/openvic-simulation/country/CountryInstance.hpp
@@ -215,15 +215,20 @@ namespace OpenVic {
bool add_owned_province(ProvinceInstance& new_province);
bool remove_owned_province(ProvinceInstance& province_to_remove);
+ bool has_owned_province(ProvinceInstance const& province) const;
bool add_controlled_province(ProvinceInstance& new_province);
bool remove_controlled_province(ProvinceInstance& province_to_remove);
+ bool has_controlled_province(ProvinceInstance const& province) const;
bool add_core_province(ProvinceInstance& new_core);
bool remove_core_province(ProvinceInstance& core_to_remove);
+ bool has_core_province(ProvinceInstance const& province) const;
bool add_state(State& new_state);
bool remove_state(State& state_to_remove);
+ bool has_state(State const& state) const;
bool add_accepted_culture(Culture const& new_accepted_culture);
bool remove_accepted_culture(Culture const& culture_to_remove);
+ bool has_accepted_culture(Culture const& culture) const;
/* Set a party's popularity in the upper house. */
bool set_upper_house(Ideology const* ideology, fixed_point_t popularity);
bool set_ruling_party(CountryParty const& new_ruling_party);