aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/research
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2024-07-19 21:35:31 +0200
committer GitHub <noreply@github.com>2024-07-19 21:35:31 +0200
commitd1f3a96b72dd06b5f97dd4643e5f016a02b42ea6 (patch)
tree38015e5729afbb98cf520e2cf26d8a4623d32f2f /src/openvic-simulation/research
parente0518bee9b4c164f40716a8033b5e207c2060c0b (diff)
parent03647d2249f72b6545628bb844685f87c4581062 (diff)
Merge pull request #176 from OpenVicProject/format-cleanup
Cleanup: inheritance, const movable variables, code formatting
Diffstat (limited to 'src/openvic-simulation/research')
-rw-r--r--src/openvic-simulation/research/Invention.cpp26
-rw-r--r--src/openvic-simulation/research/Invention.hpp13
-rw-r--r--src/openvic-simulation/research/Technology.cpp27
3 files changed, 49 insertions, 17 deletions
diff --git a/src/openvic-simulation/research/Invention.cpp b/src/openvic-simulation/research/Invention.cpp
index 9680223..5ecfcdc 100644
--- a/src/openvic-simulation/research/Invention.cpp
+++ b/src/openvic-simulation/research/Invention.cpp
@@ -8,13 +8,25 @@ using namespace OpenVic;
using namespace OpenVic::NodeTools;
Invention::Invention(
- std::string_view new_identifier, ModifierValue&& new_values, bool new_news, unit_set_t&& new_activated_units,
- building_set_t&& new_activated_buildings, crime_set_t&& new_enabled_crimes, bool new_unlock_gas_attack,
- bool new_unlock_gas_defence, ConditionScript&& new_limit, ConditionalWeight&& new_chance
-) : Modifier { new_identifier, std::move(new_values), 0 }, news { new_news },
- activated_units { std::move(new_activated_units) }, activated_buildings { std::move(new_activated_buildings) },
- enabled_crimes { std::move(new_enabled_crimes) }, unlock_gas_attack { new_unlock_gas_attack },
- unlock_gas_defence { new_unlock_gas_defence }, limit { std::move(new_limit) }, chance { std::move(new_chance) } {}
+ std::string_view new_identifier,
+ ModifierValue&& new_values,
+ bool new_news,
+ unit_set_t&& new_activated_units,
+ building_set_t&& new_activated_buildings,
+ crime_set_t&& new_enabled_crimes,
+ bool new_unlock_gas_attack,
+ bool new_unlock_gas_defence,
+ ConditionScript&& new_limit,
+ ConditionalWeight&& new_chance
+) : Modifier { new_identifier, std::move(new_values) },
+ news { new_news },
+ activated_units { std::move(new_activated_units) },
+ activated_buildings { std::move(new_activated_buildings) },
+ enabled_crimes { std::move(new_enabled_crimes) },
+ unlock_gas_attack { new_unlock_gas_attack },
+ unlock_gas_defence { new_unlock_gas_defence },
+ limit { std::move(new_limit) },
+ chance { std::move(new_chance) } {}
bool Invention::parse_scripts(DefinitionManager const& definition_manager) {
bool ret = true;
diff --git a/src/openvic-simulation/research/Invention.hpp b/src/openvic-simulation/research/Invention.hpp
index 881ceab..7c6c07b 100644
--- a/src/openvic-simulation/research/Invention.hpp
+++ b/src/openvic-simulation/research/Invention.hpp
@@ -32,9 +32,16 @@ namespace OpenVic {
ConditionalWeight PROPERTY(chance);
Invention(
- std::string_view new_identifier, ModifierValue&& new_values, bool new_news, unit_set_t&& new_activated_units,
- building_set_t&& new_activated_buildings, crime_set_t&& new_enabled_crimes, bool new_unlock_gas_attack,
- bool new_unlock_gas_defence, ConditionScript&& new_limit, ConditionalWeight&& new_chance
+ std::string_view new_identifier,
+ ModifierValue&& new_values,
+ bool new_news,
+ unit_set_t&& new_activated_units,
+ building_set_t&& new_activated_buildings,
+ crime_set_t&& new_enabled_crimes,
+ bool new_unlock_gas_attack,
+ bool new_unlock_gas_defence,
+ ConditionScript&& new_limit,
+ ConditionalWeight&& new_chance
);
bool parse_scripts(DefinitionManager const& definition_manager);
diff --git a/src/openvic-simulation/research/Technology.cpp b/src/openvic-simulation/research/Technology.cpp
index dfda3d9..737650b 100644
--- a/src/openvic-simulation/research/Technology.cpp
+++ b/src/openvic-simulation/research/Technology.cpp
@@ -9,19 +9,32 @@ TechnologyArea::TechnologyArea(std::string_view new_identifier, TechnologyFolder
: HasIdentifier { new_identifier }, folder { new_folder } {}
Technology::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
-) : Modifier { new_identifier, std::move(new_values), 0 }, area { new_area }, year { new_year }, cost { new_cost },
- unciv_military { new_unciv_military }, unit { new_unit }, activated_buildings { std::move(new_activated_units) },
- activated_units { std::move(new_activated_buildings) }, ai_chance { std::move(new_ai_chance) } {}
+ 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
+) : Modifier { new_identifier, std::move(new_values) },
+ area { new_area },
+ year { new_year },
+ cost { new_cost },
+ unciv_military { new_unciv_military },
+ unit { new_unit },
+ activated_buildings { std::move(new_activated_units) },
+ activated_units { std::move(new_activated_buildings) },
+ ai_chance { std::move(new_ai_chance) } {}
bool Technology::parse_scripts(DefinitionManager const& definition_manager) {
return ai_chance.parse_scripts(definition_manager);
}
TechnologySchool::TechnologySchool(std::string_view new_identifier, ModifierValue&& new_values)
- : Modifier { new_identifier, std::move(new_values), 0 } {}
+ : Modifier { new_identifier, std::move(new_values) } {}
bool TechnologyManager::add_technology_folder(std::string_view identifier) {
if (identifier.empty()) {