From 237e42fd1cdff02862c6a2279c7cad9786ab0e65 Mon Sep 17 00:00:00 2001 From: hop311 Date: Wed, 11 Sep 2024 00:21:03 +0100 Subject: CountryInstance unlock tech, invention, crime, building, unit, gas etc. --- src/openvic-simulation/research/Technology.hpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 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 f13cca3..3afeb0b 100644 --- a/src/openvic-simulation/research/Technology.hpp +++ b/src/openvic-simulation/research/Technology.hpp @@ -2,6 +2,7 @@ #include +#include "openvic-simulation/country/CountryInstance.hpp" #include "openvic-simulation/economy/BuildingType.hpp" #include "openvic-simulation/military/UnitType.hpp" #include "openvic-simulation/misc/Modifier.hpp" @@ -50,15 +51,16 @@ namespace OpenVic { const Date::year_t PROPERTY(year); const fixed_point_t PROPERTY(cost); const bool PROPERTY(unciv_military); - const uint8_t PROPERTY(unit); - unit_set_t PROPERTY(activated_buildings); - building_set_t PROPERTY(activated_units); + std::optional PROPERTY(unit_variant); + unit_set_t PROPERTY(activated_units); + building_set_t PROPERTY(activated_buildings); ConditionalWeight PROPERTY(ai_chance); Technology( std::string_view new_identifier, TechnologyArea const& new_area, Date::year_t new_year, fixed_point_t new_cost, - bool new_unciv_military, uint8_t new_unit, unit_set_t&& new_activated_units, - building_set_t&& new_activated_buildings, ModifierValue&& new_values, ConditionalWeight&& new_ai_chance + bool new_unciv_military, std::optional&& new_unit_variant, + unit_set_t&& new_activated_units, building_set_t&& new_activated_buildings, ModifierValue&& new_values, + ConditionalWeight&& new_ai_chance ); bool parse_scripts(DefinitionManager const& definition_manager); @@ -87,8 +89,9 @@ namespace OpenVic { 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, ConditionalWeight&& ai_chance + bool unciv_military, std::optional&& unit_variant, + Technology::unit_set_t&& activated_units, Technology::building_set_t&& activated_buildings, + ModifierValue&& values, ConditionalWeight&& ai_chance ); bool add_technology_school(std::string_view identifier, ModifierValue&& values); -- cgit v1.2.3-56-ga3b1