From 50327abf33078c44fef85c62ce3d90e23056fb34 Mon Sep 17 00:00:00 2001 From: Hop311 Date: Tue, 25 Apr 2023 21:35:59 +0100 Subject: Further cleanup + reset on return to main menu --- extension/src/openvic2/map/Province.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'extension/src/openvic2/map/Province.cpp') 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 const& Province::get_buildings() const { return buildings.get_items(); } -- cgit v1.2.3-56-ga3b1