From 3550c455526eb6f8935f488810e73fe01a1177a9 Mon Sep 17 00:00:00 2001 From: Hop311 Date: Mon, 8 May 2023 22:01:13 +0100 Subject: Added GoodManager --- src/openvic2/map/Province.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/openvic2/map/Province.cpp') diff --git a/src/openvic2/map/Province.cpp b/src/openvic2/map/Province.cpp index b3d455b..6c80317 100644 --- a/src/openvic2/map/Province.cpp +++ b/src/openvic2/map/Province.cpp @@ -9,7 +9,6 @@ using namespace OpenVic2; Province::Province(index_t new_index, std::string const& new_identifier, colour_t new_colour) : HasIdentifier{ new_identifier }, HasColour{ new_colour }, index{ new_index }, buildings{ "buildings" } { assert(index != NULL_INDEX); - assert(new_colour != NULL_COLOUR); } index_t Province::get_index() const { @@ -40,6 +39,10 @@ void Province::reset_buildings() { buildings.reset(); } +Building const* Province::get_building_by_identifier(std::string const& identifier) const { + return buildings.get_item_by_identifier(identifier); +} + std::vector const& Province::get_buildings() const { return buildings.get_items(); } @@ -50,6 +53,10 @@ return_t Province::expand_building(std::string const& building_type_identifier) return building->expand(); } +Good const* Province::get_rgo() const { + return rgo; +} + std::string Province::to_string() const { std::stringstream stream; stream << "(#" << std::to_string(index) << ", " << get_identifier() << ", 0x" << colour_to_hex_string() << ")"; -- cgit v1.2.3-56-ga3b1