aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/research/Technology.hpp
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2023-12-31 01:47:31 +0100
committer hop311 <hop3114@gmail.com>2024-01-02 14:41:28 +0100
commit5f64f983d0cead266a28791be42162c443fd2a75 (patch)
treeda5fbb48d6c01d6faedd16b46ff846c65fdb4c33 /src/openvic-simulation/research/Technology.hpp
parent9988b21278dc1c8df044631bd2935a7e450a7bff (diff)
Added framework for loading all Conditions and Effects
Diffstat (limited to 'src/openvic-simulation/research/Technology.hpp')
-rw-r--r--src/openvic-simulation/research/Technology.hpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/openvic-simulation/research/Technology.hpp b/src/openvic-simulation/research/Technology.hpp
index 3b0b1da..a4287a5 100644
--- a/src/openvic-simulation/research/Technology.hpp
+++ b/src/openvic-simulation/research/Technology.hpp
@@ -5,6 +5,7 @@
#include "openvic-simulation/economy/BuildingType.hpp"
#include "openvic-simulation/military/Unit.hpp"
#include "openvic-simulation/misc/Modifier.hpp"
+#include "openvic-simulation/scripts/ConditionalWeight.hpp"
#include "openvic-simulation/types/Date.hpp"
#include "openvic-simulation/types/OrderedContainers.hpp"
@@ -43,17 +44,18 @@ namespace OpenVic {
const fixed_point_t PROPERTY(cost);
const bool PROPERTY(unciv_military);
const uint8_t PROPERTY(unit);
- const unit_set_t PROPERTY(activated_buildings);
- const building_set_t PROPERTY(activated_units);
-
- //TODO: implement rules/modifiers and ai_chance
+ unit_set_t PROPERTY(activated_buildings);
+ building_set_t PROPERTY(activated_units);
+ 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
+ building_set_t&& new_activated_buildings, ModifierValue&& new_values, ConditionalWeight&& new_ai_chance
);
+ bool parse_scripts(GameManager const& game_manager);
+
public:
Technology(Technology&&) = default;
};
@@ -79,7 +81,8 @@ 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);
+ Technology::building_set_t&& activated_buildings, ModifierValue&& values, ConditionalWeight&& ai_chance
+ );
bool add_technology_school(std::string_view identifier, ModifierValue&& values);
@@ -90,5 +93,7 @@ namespace OpenVic {
BuildingTypeManager const& building_type_manager, ast::NodeCPtr root
); // technologies/*.txt
bool generate_modifiers(ModifierManager& modifier_manager) const;
+
+ bool parse_scripts(GameManager const& game_manager);
};
} \ No newline at end of file