aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic2/Region.cpp
blob: 67a75a91be9de44b224822950bf41263d98620fb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include "Region.hpp"

#include <cassert>
#include <algorithm>

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) {}

Province::colour_t Region::get_colour() const {
   if (provinces.empty()) return 0xFF0000;
   Province const* province = *provinces.cbegin();
   return province->get_colour();
}