aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/map/Province.cpp
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2023-12-12 01:34:53 +0100
committer hop311 <hop3114@gmail.com>2023-12-13 20:54:36 +0100
commit89c93f98b865c20cd3c3486a9b91323565e759fc (patch)
tree54155b9cf2a4384585941495f7525b77fa60d4e7 /src/openvic-simulation/map/Province.cpp
parentf556519575bbbf24d247f341ca762fb1878ed64d (diff)
Province pop history + country government flag override refactors
Diffstat (limited to 'src/openvic-simulation/map/Province.cpp')
-rw-r--r--src/openvic-simulation/map/Province.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/openvic-simulation/map/Province.cpp b/src/openvic-simulation/map/Province.cpp
index 19d06df..8094463 100644
--- a/src/openvic-simulation/map/Province.cpp
+++ b/src/openvic-simulation/map/Province.cpp
@@ -68,6 +68,19 @@ bool Province::add_pop(Pop&& pop) {
}
}
+bool Province::add_pop_vec(std::vector<Pop> const& pop_vec) {
+ if (!get_water()) {
+ pops.reserve(pops.size() + pop_vec.size());
+ for (Pop const& pop : pop_vec) {
+ pops.push_back(pop);
+ }
+ return true;
+ } else {
+ Logger::error("Trying to add pop vector to water province ", get_identifier());
+ return false;
+ }
+}
+
size_t Province::get_pop_count() const {
return pops.size();
}