diff options
author | ClarkeCode <clarke.john.robert@gmail.com> | 2023-05-01 02:48:35 +0200 |
---|---|---|
committer | ClarkeCode <clarke.john.robert@gmail.com> | 2023-05-01 02:48:35 +0200 |
commit | c92481448159d3a363d6a99b3025bd2358c3dab6 (patch) | |
tree | 3ee57808029036a7edab750f4454aeb6c50f3df3 /map/Region.cpp |
Initial commit
Diffstat (limited to 'map/Region.cpp')
-rw-r--r-- | map/Region.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/map/Region.cpp b/map/Region.cpp new file mode 100644 index 0000000..da0dfdd --- /dev/null +++ b/map/Region.cpp @@ -0,0 +1,24 @@ +#include "Region.hpp" + +#include <cassert> + +using namespace OpenVic2; + +size_t ProvinceSet::get_province_count() const { + return provinces.size(); +} + +bool ProvinceSet::contains_province(Province const* province) const { + return province && std::find(provinces.begin(), provinces.end(), province) != provinces.end(); +} + +std::set<Province*> const& ProvinceSet::get_provinces() const { + return provinces; +} + +Region::Region(std::string const& new_identifier) : HasIdentifier{ new_identifier } {} + +colour_t Region::get_colour() const { + if (provinces.empty()) return 0xFF0000; + return (*provinces.cbegin())->get_colour(); +} |