aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic2/map/Province.cpp
diff options
context:
space:
mode:
author Hop311 <hop3114@gmail.com>2023-04-25 22:35:59 +0200
committer Hop311 <hop3114@gmail.com>2023-04-25 22:35:59 +0200
commit50327abf33078c44fef85c62ce3d90e23056fb34 (patch)
treef39e8fe64c024ecfde01d2bc4faacb7cf0dddc2c /extension/src/openvic2/map/Province.cpp
parent8fba1c8a02f8680e0d80279b8b6451fea4a40a62 (diff)
Further cleanup + reset on return to main menu
Diffstat (limited to 'extension/src/openvic2/map/Province.cpp')
-rw-r--r--extension/src/openvic2/map/Province.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/extension/src/openvic2/map/Province.cpp b/extension/src/openvic2/map/Province.cpp
index 08711af..4360bce 100644
--- a/extension/src/openvic2/map/Province.cpp
+++ b/extension/src/openvic2/map/Province.cpp
@@ -6,10 +6,8 @@
using namespace OpenVic2;
-const char Province::buildings_name[] = "buildings";
-
Province::Province(index_t new_index, std::string const& new_identifier, colour_t new_colour) :
- HasIdentifier{ new_identifier }, index{ new_index }, colour{ new_colour } {
+ HasIdentifier{ new_identifier }, index{ new_index }, colour{ new_colour }, buildings{ "buildings" } {
assert(index != NULL_INDEX);
assert(colour != NULL_COLOUR);
}
@@ -40,6 +38,18 @@ Province::life_rating_t Province::get_life_rating() const {
return life_rating;
}
+return_t Province::add_building(BuildingType const& type) {
+ return buildings.add_item({ type });
+}
+
+void Province::lock_buildings() {
+ buildings.lock(false);
+}
+
+void Province::reset_buildings() {
+ buildings.reset();
+}
+
std::vector<Building> const& Province::get_buildings() const {
return buildings.get_items();
}