diff options
author | Hop311 <hop3114@gmail.com> | 2023-09-08 01:34:47 +0200 |
---|---|---|
committer | Hop311 <hop3114@gmail.com> | 2023-09-08 01:34:47 +0200 |
commit | 7f9a9a8241ba81be9213e6606b8be4a48f1cbaab (patch) | |
tree | 26b67f150ec1b43593343344eabdc7deca47d0d8 /src/openvic/map/Region.cpp | |
parent | 3cd1d62ec00690a1b29070dd4903754e8f089a21 (diff) |
Remove return_t, use & instead of if(x != SUCCESS)
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(); } |