diff options
Diffstat (limited to 'src/openvic/map/Region.cpp')
-rw-r--r-- | src/openvic/map/Region.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/openvic/map/Region.cpp b/src/openvic/map/Region.cpp index 6372e15..33092c5 100644 --- a/src/openvic/map/Region.cpp +++ b/src/openvic/map/Region.cpp @@ -2,21 +2,21 @@ using namespace OpenVic; -return_t ProvinceSet::add_province(Province* province) { +bool ProvinceSet::add_province(Province* province) { if (locked) { Logger::error("Cannot add province to province set - locked!"); - return FAILURE; + return false; } if (province == nullptr) { Logger::error("Cannot add province to province set - null province!"); - return FAILURE; + return false; } if (contains_province(province)) { Logger::error("Cannot add province ", province->get_identifier(), " to province set - already in the set!"); - return FAILURE; + return false; } provinces.push_back(province); - return SUCCESS; + return true; } void ProvinceSet::lock(bool log) { @@ -37,6 +37,10 @@ void ProvinceSet::reset() { locked = false; } +bool ProvinceSet::empty() const { + return provinces.empty(); +} + size_t ProvinceSet::size() const { return provinces.size(); } |