aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic2/Region.cpp
blob: 6ee05f5b689d959c04e0b553bed6fe5793872911 (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 "Map.hpp"

#include <cassert>
#include <algorithm>

using namespace OpenVic2;

Region::Region(std::string const& new_identifier) : identifier(new_identifier) {
   assert(!identifier.empty());
}

std::string const& Region::get_identifier() const {
   return identifier;
}

size_t Region::get_province_count() const {
   return provinces.size();
}

bool Region::contains_province(Province const* province) const {
   return province && std::find(provinces.begin(), provinces.end(), province) != provinces.end();
}

std::vector<Province*> const& Region::get_provinces() const {
   return provinces;
}