From 4ef33d4df6198e613b0f27406d49978c8ea2fb97 Mon Sep 17 00:00:00 2001 From: zaaarf Date: Sun, 10 Dec 2023 23:15:41 +0100 Subject: feat: improved identifier registry macro --- src/openvic-simulation/research/Technology.hpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src/openvic-simulation/research/Technology.hpp') diff --git a/src/openvic-simulation/research/Technology.hpp b/src/openvic-simulation/research/Technology.hpp index 52db87e..8489e9b 100644 --- a/src/openvic-simulation/research/Technology.hpp +++ b/src/openvic-simulation/research/Technology.hpp @@ -64,28 +64,22 @@ namespace OpenVic { }; struct TechnologyManager { - IdentifierRegistry technology_folders; - IdentifierRegistry technology_areas; - IdentifierRegistry technologies; - IdentifierRegistry technology_schools; + IdentifierRegistry IDENTIFIER_REGISTRY(technology_folder); + IdentifierRegistry IDENTIFIER_REGISTRY(technology_area); + IdentifierRegistry IDENTIFIER_REGISTRY_CUSTOM_PLURAL(technology, technologies); + IdentifierRegistry IDENTIFIER_REGISTRY(technology_school); public: - TechnologyManager(); - bool add_technology_folder(std::string_view identifier); - IDENTIFIER_REGISTRY_ACCESSORS(technology_folder) bool add_technology_area(std::string_view identifier, TechnologyFolder const* folder); - IDENTIFIER_REGISTRY_ACCESSORS(technology_area) bool add_technology( std::string_view identifier, TechnologyArea const* area, Date::year_t year, fixed_point_t cost, bool unciv_military, uint8_t unit, Technology::unit_set_t&& activated_units, Technology::building_set_t&& activated_buildings, ModifierValue&& values); - IDENTIFIER_REGISTRY_ACCESSORS_CUSTOM_PLURAL(technology, technologies) bool add_technology_school(std::string_view identifier, ModifierValue&& values); - IDENTIFIER_REGISTRY_ACCESSORS(technology_school) bool load_technology_file_areas(ast::NodeCPtr root); // common/technology.txt bool load_technology_file_schools(ModifierManager const& modifier_manager, ast::NodeCPtr root); // also common/technology.txt -- cgit v1.2.3-56-ga3b1