From 89c93f98b865c20cd3c3486a9b91323565e759fc Mon Sep 17 00:00:00 2001 From: hop311 Date: Tue, 12 Dec 2023 00:34:53 +0000 Subject: Province pop history + country government flag override refactors --- src/openvic-simulation/map/Province.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/openvic-simulation/map/Province.cpp') 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 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(); } -- cgit v1.2.3-56-ga3b1