aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/scripts
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2024-06-13 00:24:00 +0200
committer hop311 <hop3114@gmail.com>2024-06-13 00:24:00 +0200
commit4b39e77304094708d5c503b6a221386408cc4409 (patch)
tree7ba5a06714c267185dd3a59aabc6556a105c122f /src/openvic-simulation/scripts
parentc0ba822ee46551a40ad6b43e8f56b80e27ae35b5 (diff)
Separated GameManager into Definition and Instance Managersinstance-definition-managers
Diffstat (limited to 'src/openvic-simulation/scripts')
-rw-r--r--src/openvic-simulation/scripts/Condition.cpp110
-rw-r--r--src/openvic-simulation/scripts/Condition.hpp16
-rw-r--r--src/openvic-simulation/scripts/ConditionScript.cpp8
-rw-r--r--src/openvic-simulation/scripts/ConditionScript.hpp6
-rw-r--r--src/openvic-simulation/scripts/ConditionalWeight.cpp12
-rw-r--r--src/openvic-simulation/scripts/ConditionalWeight.hpp2
-rw-r--r--src/openvic-simulation/scripts/EffectScript.cpp2
-rw-r--r--src/openvic-simulation/scripts/EffectScript.hpp6
-rw-r--r--src/openvic-simulation/scripts/Script.hpp1
9 files changed, 85 insertions, 78 deletions
diff --git a/src/openvic-simulation/scripts/Condition.cpp b/src/openvic-simulation/scripts/Condition.cpp
index f754420..e5679f8 100644
--- a/src/openvic-simulation/scripts/Condition.cpp
+++ b/src/openvic-simulation/scripts/Condition.cpp
@@ -1,7 +1,7 @@
#include "Condition.hpp"
#include "openvic-simulation/dataloader/NodeTools.hpp"
-#include "openvic-simulation/GameManager.hpp"
+#include "openvic-simulation/DefinitionManager.hpp"
using namespace OpenVic;
using namespace OpenVic::NodeTools;
@@ -65,7 +65,7 @@ bool ConditionManager::add_condition(
});
}
-bool ConditionManager::setup_conditions(GameManager const& game_manager) {
+bool ConditionManager::setup_conditions(DefinitionManager const& definition_manager) {
bool ret = true;
/* Special Scopes */
@@ -352,7 +352,7 @@ bool ConditionManager::setup_conditions(GameManager const& game_manager) {
/* Scopes from other registries */
import_identifiers(
- game_manager.get_country_manager().get_country_identifiers(),
+ definition_manager.get_country_manager().get_country_identifiers(),
GROUP,
COUNTRY,
COUNTRY,
@@ -361,7 +361,7 @@ bool ConditionManager::setup_conditions(GameManager const& game_manager) {
);
import_identifiers(
- game_manager.get_map_definition().get_region_identifiers(),
+ definition_manager.get_map_definition().get_region_identifiers(),
GROUP,
COUNTRY,
STATE,
@@ -370,7 +370,7 @@ bool ConditionManager::setup_conditions(GameManager const& game_manager) {
);
import_identifiers(
- game_manager.get_map_definition().get_province_definition_identifiers(),
+ definition_manager.get_map_definition().get_province_definition_identifiers(),
GROUP,
COUNTRY,
PROVINCE,
@@ -380,7 +380,7 @@ bool ConditionManager::setup_conditions(GameManager const& game_manager) {
/* Conditions from other registries */
import_identifiers(
- game_manager.get_politics_manager().get_ideology_manager().get_ideology_identifiers(),
+ definition_manager.get_politics_manager().get_ideology_manager().get_ideology_identifiers(),
REAL,
COUNTRY,
NO_SCOPE,
@@ -389,7 +389,7 @@ bool ConditionManager::setup_conditions(GameManager const& game_manager) {
);
import_identifiers(
- game_manager.get_politics_manager().get_issue_manager().get_reform_group_identifiers(),
+ definition_manager.get_politics_manager().get_issue_manager().get_reform_group_identifiers(),
IDENTIFIER,
COUNTRY,
NO_SCOPE,
@@ -398,7 +398,7 @@ bool ConditionManager::setup_conditions(GameManager const& game_manager) {
);
import_identifiers(
- game_manager.get_politics_manager().get_issue_manager().get_reform_identifiers(),
+ definition_manager.get_politics_manager().get_issue_manager().get_reform_identifiers(),
REAL,
COUNTRY,
NO_SCOPE,
@@ -407,7 +407,7 @@ bool ConditionManager::setup_conditions(GameManager const& game_manager) {
);
import_identifiers(
- game_manager.get_politics_manager().get_issue_manager().get_issue_identifiers(),
+ definition_manager.get_politics_manager().get_issue_manager().get_issue_identifiers(),
REAL,
COUNTRY,
NO_SCOPE,
@@ -416,7 +416,7 @@ bool ConditionManager::setup_conditions(GameManager const& game_manager) {
);
import_identifiers(
- game_manager.get_pop_manager().get_pop_type_identifiers(),
+ definition_manager.get_pop_manager().get_pop_type_identifiers(),
REAL,
COUNTRY,
NO_SCOPE,
@@ -425,7 +425,7 @@ bool ConditionManager::setup_conditions(GameManager const& game_manager) {
);
import_identifiers(
- game_manager.get_research_manager().get_technology_manager().get_technology_identifiers(),
+ definition_manager.get_research_manager().get_technology_manager().get_technology_identifiers(),
BOOLEAN_INT,
COUNTRY,
NO_SCOPE,
@@ -434,7 +434,7 @@ bool ConditionManager::setup_conditions(GameManager const& game_manager) {
);
import_identifiers(
- game_manager.get_economy_manager().get_good_definition_manager().get_good_definition_identifiers(),
+ definition_manager.get_economy_manager().get_good_definition_manager().get_good_definition_identifiers(),
INTEGER,
COUNTRY,
NO_SCOPE,
@@ -456,10 +456,10 @@ bool ConditionManager::setup_conditions(GameManager const& game_manager) {
}
callback_t<std::string_view> ConditionManager::expect_parse_identifier(
- GameManager const& game_manager, identifier_type_t identifier_type,
+ DefinitionManager const& definition_manager, identifier_type_t identifier_type,
callback_t<HasIdentifier const*> callback
) const {
- return [this, &game_manager, identifier_type, callback](std::string_view identifier) -> bool {
+ return [this, &definition_manager, identifier_type, callback](std::string_view identifier) -> bool {
HasIdentifier const* identified = nullptr;
#define EXPECT_CALL(type, name, manager, ...) \
@@ -484,33 +484,33 @@ callback_t<std::string_view> ConditionManager::expect_parse_identifier(
EXPECT_CALL_PLACEHOLDER(GLOBAL_FLAG);
EXPECT_CALL_PLACEHOLDER(COUNTRY_FLAG);
EXPECT_CALL_PLACEHOLDER(PROVINCE_FLAG);
- EXPECT_CALL(COUNTRY_TAG, country, game_manager.get_country_manager(), "THIS", "FROM", "OWNER");
- EXPECT_CALL(PROVINCE_ID, province_definition, game_manager.get_map_definition(), "THIS", "FROM");
- EXPECT_CALL(REGION, region, game_manager.get_map_definition());
- EXPECT_CALL(IDEOLOGY, ideology, game_manager.get_politics_manager().get_ideology_manager());
- EXPECT_CALL(REFORM_GROUP, reform_group, game_manager.get_politics_manager().get_issue_manager());
- EXPECT_CALL(REFORM, reform, game_manager.get_politics_manager().get_issue_manager());
- EXPECT_CALL(ISSUE, issue, game_manager.get_politics_manager().get_issue_manager());
- EXPECT_CALL(POP_TYPE, pop_type, game_manager.get_pop_manager());
- EXPECT_CALL(POP_STRATA, strata, game_manager.get_pop_manager());
- EXPECT_CALL(TECHNOLOGY, technology, game_manager.get_research_manager().get_technology_manager());
- EXPECT_CALL(INVENTION, invention, game_manager.get_research_manager().get_invention_manager());
- EXPECT_CALL(TECH_SCHOOL, technology_school, game_manager.get_research_manager().get_technology_manager());
- EXPECT_CALL(CULTURE, culture, game_manager.get_pop_manager().get_culture_manager(), "THIS", "FROM");
- EXPECT_CALL(CULTURE_GROUP, culture_group, game_manager.get_pop_manager().get_culture_manager());
- EXPECT_CALL(RELIGION, religion, game_manager.get_pop_manager().get_religion_manager(), "THIS", "FROM");
- EXPECT_CALL(TRADE_GOOD, good_definition, game_manager.get_economy_manager().get_good_definition_manager());
- EXPECT_CALL(BUILDING, building_type, game_manager.get_economy_manager().get_building_type_manager(), "FACTORY");
- EXPECT_CALL(CASUS_BELLI, wargoal_type, game_manager.get_military_manager().get_wargoal_type_manager());
- EXPECT_CALL(GOVERNMENT_TYPE, government_type, game_manager.get_politics_manager().get_government_type_manager());
- EXPECT_CALL(MODIFIER, event_modifier, game_manager.get_modifier_manager());
- EXPECT_CALL(MODIFIER, triggered_modifier, game_manager.get_modifier_manager());
- EXPECT_CALL(MODIFIER, static_modifier, game_manager.get_modifier_manager());
- EXPECT_CALL(NATIONAL_VALUE, national_value, game_manager.get_politics_manager().get_national_value_manager());
- EXPECT_CALL(CULTURE_UNION, country, game_manager.get_country_manager(), "THIS", "FROM", "THIS_UNION");
- EXPECT_CALL(CONTINENT, continent, game_manager.get_map_definition());
- EXPECT_CALL(CRIME, crime_modifier, game_manager.get_crime_manager());
- EXPECT_CALL(TERRAIN, terrain_type, game_manager.get_map_definition().get_terrain_type_manager());
+ EXPECT_CALL(COUNTRY_TAG, country, definition_manager.get_country_manager(), "THIS", "FROM", "OWNER");
+ EXPECT_CALL(PROVINCE_ID, province_definition, definition_manager.get_map_definition(), "THIS", "FROM");
+ EXPECT_CALL(REGION, region, definition_manager.get_map_definition());
+ EXPECT_CALL(IDEOLOGY, ideology, definition_manager.get_politics_manager().get_ideology_manager());
+ EXPECT_CALL(REFORM_GROUP, reform_group, definition_manager.get_politics_manager().get_issue_manager());
+ EXPECT_CALL(REFORM, reform, definition_manager.get_politics_manager().get_issue_manager());
+ EXPECT_CALL(ISSUE, issue, definition_manager.get_politics_manager().get_issue_manager());
+ EXPECT_CALL(POP_TYPE, pop_type, definition_manager.get_pop_manager());
+ EXPECT_CALL(POP_STRATA, strata, definition_manager.get_pop_manager());
+ EXPECT_CALL(TECHNOLOGY, technology, definition_manager.get_research_manager().get_technology_manager());
+ EXPECT_CALL(INVENTION, invention, definition_manager.get_research_manager().get_invention_manager());
+ EXPECT_CALL(TECH_SCHOOL, technology_school, definition_manager.get_research_manager().get_technology_manager());
+ EXPECT_CALL(CULTURE, culture, definition_manager.get_pop_manager().get_culture_manager(), "THIS", "FROM");
+ EXPECT_CALL(CULTURE_GROUP, culture_group, definition_manager.get_pop_manager().get_culture_manager());
+ EXPECT_CALL(RELIGION, religion, definition_manager.get_pop_manager().get_religion_manager(), "THIS", "FROM");
+ EXPECT_CALL(TRADE_GOOD, good_definition, definition_manager.get_economy_manager().get_good_definition_manager());
+ EXPECT_CALL(BUILDING, building_type, definition_manager.get_economy_manager().get_building_type_manager(), "FACTORY");
+ EXPECT_CALL(CASUS_BELLI, wargoal_type, definition_manager.get_military_manager().get_wargoal_type_manager());
+ EXPECT_CALL(GOVERNMENT_TYPE, government_type, definition_manager.get_politics_manager().get_government_type_manager());
+ EXPECT_CALL(MODIFIER, event_modifier, definition_manager.get_modifier_manager());
+ EXPECT_CALL(MODIFIER, triggered_modifier, definition_manager.get_modifier_manager());
+ EXPECT_CALL(MODIFIER, static_modifier, definition_manager.get_modifier_manager());
+ EXPECT_CALL(NATIONAL_VALUE, national_value, definition_manager.get_politics_manager().get_national_value_manager());
+ EXPECT_CALL(CULTURE_UNION, country, definition_manager.get_country_manager(), "THIS", "FROM", "THIS_UNION");
+ EXPECT_CALL(CONTINENT, continent, definition_manager.get_map_definition());
+ EXPECT_CALL(CRIME, crime_modifier, definition_manager.get_crime_manager());
+ EXPECT_CALL(TERRAIN, terrain_type, definition_manager.get_map_definition().get_terrain_type_manager());
#undef EXPECT_CALL
#undef EXPECT_CALL_PLACEHOLDER
@@ -520,10 +520,10 @@ callback_t<std::string_view> ConditionManager::expect_parse_identifier(
}
node_callback_t ConditionManager::expect_condition_node(
- GameManager const& game_manager, Condition const& condition, scope_t this_scope,
+ DefinitionManager const& definition_manager, Condition const& condition, scope_t this_scope,
scope_t from_scope, scope_t cur_scope, callback_t<ConditionNode&&> callback
) const {
- return [this, &game_manager, &condition, callback, this_scope, from_scope, cur_scope](
+ return [this, &definition_manager, &condition, callback, this_scope, from_scope, cur_scope](
ast::NodeCPtr node
) -> bool {
bool ret = false;
@@ -538,12 +538,12 @@ node_callback_t ConditionManager::expect_condition_node(
HasIdentifier const* value_item = nullptr;
- const auto get_identifiable = [this, &game_manager](
+ const auto get_identifiable = [this, &definition_manager](
identifier_type_t item_type, std::string_view id, bool log
) -> HasIdentifier const* {
HasIdentifier const* keyval = nullptr;
bool ret = expect_parse_identifier(
- game_manager,
+ definition_manager,
item_type,
assign_variable_callback(keyval)
)(id);
@@ -591,7 +591,9 @@ node_callback_t ConditionManager::expect_condition_node(
//entries with magic syntax, thanks paradox!
if (!ret && share_value_type(value_type, COMPLEX)) {
- const auto expect_pair = [&ret, &value, node](std::string_view identifier_key, std::string_view value_key) -> void {
+ const auto expect_pair = [&ret, &value, node](
+ std::string_view identifier_key, std::string_view value_key
+ ) -> void {
std::string_view pair_identifier {};
fixed_point_t pair_value = 0;
ret |= expect_dictionary_keys(
@@ -642,7 +644,7 @@ node_callback_t ConditionManager::expect_condition_node(
if (!ret && share_value_type(value_type, GROUP)) {
ConditionNode::condition_list_t node_list;
ret |= expect_condition_node_list(
- game_manager, this_scope, from_scope,
+ definition_manager, this_scope, from_scope,
scope_change == NO_SCOPE ? cur_scope : scope_change,
false,
vector_callback(node_list)
@@ -701,15 +703,15 @@ static bool top_scope_fallback(std::string_view id, ast::NodeCPtr node) {
};
node_callback_t ConditionManager::expect_condition_node_list(
- GameManager const& game_manager, scope_t this_scope, scope_t from_scope,
+ DefinitionManager const& definition_manager, scope_t this_scope, scope_t from_scope,
scope_t cur_scope, bool top_scope, callback_t<ConditionNode&&> callback
) const {
- return [this, &game_manager, callback, this_scope, from_scope, cur_scope, top_scope](ast::NodeCPtr node) -> bool {
+ return [this, &definition_manager, callback, this_scope, from_scope, cur_scope, top_scope](ast::NodeCPtr node) -> bool {
const auto expect_node = [
- this, &game_manager, callback, this_scope, from_scope, cur_scope
+ this, &definition_manager, callback, this_scope, from_scope, cur_scope
](Condition const& condition, ast::NodeCPtr node) -> bool {
return expect_condition_node(
- game_manager, condition, this_scope, from_scope, cur_scope, callback
+ definition_manager, condition, this_scope, from_scope, cur_scope, callback
)(node);
};
@@ -724,14 +726,14 @@ node_callback_t ConditionManager::expect_condition_node_list(
}
node_callback_t ConditionManager::expect_condition_script(
- GameManager const& game_manager, scope_t initial_scope, scope_t this_scope,
+ DefinitionManager const& definition_manager, scope_t initial_scope, scope_t this_scope,
scope_t from_scope, callback_t<ConditionNode&&> callback
) const {
- return [this, &game_manager, initial_scope, this_scope, from_scope, callback](ast::NodeCPtr node) -> bool {
+ return [this, &definition_manager, initial_scope, this_scope, from_scope, callback](ast::NodeCPtr node) -> bool {
ConditionNode::condition_list_t conds;
bool ret = expect_condition_node_list(
- game_manager,
+ definition_manager,
this_scope,
from_scope,
initial_scope,
diff --git a/src/openvic-simulation/scripts/Condition.hpp b/src/openvic-simulation/scripts/Condition.hpp
index 5aa45e8..748453f 100644
--- a/src/openvic-simulation/scripts/Condition.hpp
+++ b/src/openvic-simulation/scripts/Condition.hpp
@@ -10,7 +10,7 @@
namespace OpenVic {
struct ConditionManager;
struct ConditionScript;
- struct GameManager;
+ struct DefinitionManager;
enum class value_type_t : uint8_t {
NO_TYPE = 0,
@@ -222,7 +222,9 @@ namespace OpenVic {
using real_t = fixed_point_t;
using identifier_real_t = std::pair<std::string, real_t>;
using condition_list_t = std::vector<ConditionNode>;
- using value_t = std::variant<string_t, boolean_t, double_boolean_t, integer_t, real_t, identifier_real_t, condition_list_t>;
+ using value_t = std::variant<
+ string_t, boolean_t, double_boolean_t, integer_t, real_t, identifier_real_t, condition_list_t
+ >;
private:
Condition const* PROPERTY(condition);
@@ -252,25 +254,25 @@ namespace OpenVic {
);
NodeTools::callback_t<std::string_view> expect_parse_identifier(
- GameManager const& game_manager, identifier_type_t identifier_type,
+ DefinitionManager const& definition_manager, identifier_type_t identifier_type,
NodeTools::callback_t<HasIdentifier const*> callback
) const;
NodeTools::node_callback_t expect_condition_node(
- GameManager const& game_manager, Condition const& condition, scope_t this_scope,
+ DefinitionManager const& definition_manager, Condition const& condition, scope_t this_scope,
scope_t from_scope, scope_t cur_scope, NodeTools::callback_t<ConditionNode&&> callback
) const;
NodeTools::node_callback_t expect_condition_node_list(
- GameManager const& game_manager, scope_t this_scope, scope_t from_scope,
+ DefinitionManager const& definition_manager, scope_t this_scope, scope_t from_scope,
scope_t cur_scope, bool top_scope, NodeTools::callback_t<ConditionNode&&> callback
) const;
public:
- bool setup_conditions(GameManager const& game_manager);
+ bool setup_conditions(DefinitionManager const& definition_manager);
NodeTools::node_callback_t expect_condition_script(
- GameManager const& game_manager, scope_t initial_scope, scope_t this_scope, scope_t from_scope,
+ DefinitionManager const& definition_manager, scope_t initial_scope, scope_t this_scope, scope_t from_scope,
NodeTools::callback_t<ConditionNode&&> callback
) const;
};
diff --git a/src/openvic-simulation/scripts/ConditionScript.cpp b/src/openvic-simulation/scripts/ConditionScript.cpp
index 368054b..bee4d07 100644
--- a/src/openvic-simulation/scripts/ConditionScript.cpp
+++ b/src/openvic-simulation/scripts/ConditionScript.cpp
@@ -1,6 +1,6 @@
#include "ConditionScript.hpp"
-#include "openvic-simulation/GameManager.hpp"
+#include "openvic-simulation/DefinitionManager.hpp"
using namespace OpenVic;
using namespace OpenVic::NodeTools;
@@ -9,9 +9,9 @@ ConditionScript::ConditionScript(
scope_t new_initial_scope, scope_t new_this_scope, scope_t new_from_scope
) : initial_scope { new_initial_scope }, this_scope { new_this_scope }, from_scope { new_from_scope } {}
-bool ConditionScript::_parse_script(ast::NodeCPtr root, GameManager const& game_manager) {
- return game_manager.get_script_manager().get_condition_manager().expect_condition_script(
- game_manager,
+bool ConditionScript::_parse_script(ast::NodeCPtr root, DefinitionManager const& definition_manager) {
+ return definition_manager.get_script_manager().get_condition_manager().expect_condition_script(
+ definition_manager,
initial_scope,
this_scope,
from_scope,
diff --git a/src/openvic-simulation/scripts/ConditionScript.hpp b/src/openvic-simulation/scripts/ConditionScript.hpp
index 4c7d01f..e6ed255 100644
--- a/src/openvic-simulation/scripts/ConditionScript.hpp
+++ b/src/openvic-simulation/scripts/ConditionScript.hpp
@@ -4,9 +4,9 @@
#include "openvic-simulation/scripts/Script.hpp"
namespace OpenVic {
- struct GameManager;
+ struct DefinitionManager;
- struct ConditionScript final : Script<GameManager const&> {
+ struct ConditionScript final : Script<DefinitionManager const&> {
private:
ConditionNode PROPERTY_REF(condition_root);
@@ -15,7 +15,7 @@ namespace OpenVic {
scope_t PROPERTY(from_scope);
protected:
- bool _parse_script(ast::NodeCPtr root, GameManager const& game_manager) override;
+ bool _parse_script(ast::NodeCPtr root, DefinitionManager const& definition_manager) override;
public:
ConditionScript(scope_t new_initial_scope, scope_t new_this_scope, scope_t new_from_scope);
diff --git a/src/openvic-simulation/scripts/ConditionalWeight.cpp b/src/openvic-simulation/scripts/ConditionalWeight.cpp
index e5bb7d0..7c3e0a0 100644
--- a/src/openvic-simulation/scripts/ConditionalWeight.cpp
+++ b/src/openvic-simulation/scripts/ConditionalWeight.cpp
@@ -7,7 +7,9 @@ ConditionalWeight::ConditionalWeight(scope_t new_initial_scope, scope_t new_this
: initial_scope { new_initial_scope }, this_scope { new_this_scope }, from_scope { new_from_scope } {}
template<typename T>
-static NodeCallback auto expect_modifier(std::vector<T>& items, scope_t initial_scope, scope_t this_scope, scope_t from_scope) {
+static NodeCallback auto expect_modifier(
+ std::vector<T>& items, scope_t initial_scope, scope_t this_scope, scope_t from_scope
+) {
return [&items, initial_scope, this_scope, from_scope](ast::NodeCPtr node) -> bool {
fixed_point_t weight = 0;
bool successful = false;
@@ -46,10 +48,10 @@ node_callback_t ConditionalWeight::expect_conditional_weight(base_key_t base_key
}
struct ConditionalWeight::parse_scripts_visitor_t {
- GameManager const& game_manager;
+ DefinitionManager const& definition_manager;
bool operator()(condition_weight_t& condition_weight) const {
- return condition_weight.second.parse_script(false, game_manager);
+ return condition_weight.second.parse_script(false, definition_manager);
}
bool operator()(condition_weight_item_t& item) const {
return std::visit(*this, item);
@@ -64,6 +66,6 @@ struct ConditionalWeight::parse_scripts_visitor_t {
}
};
-bool ConditionalWeight::parse_scripts(GameManager const& game_manager) {
- return parse_scripts_visitor_t { game_manager }(condition_weight_items);
+bool ConditionalWeight::parse_scripts(DefinitionManager const& definition_manager) {
+ return parse_scripts_visitor_t { definition_manager }(condition_weight_items);
}
diff --git a/src/openvic-simulation/scripts/ConditionalWeight.hpp b/src/openvic-simulation/scripts/ConditionalWeight.hpp
index 7453fe9..c99d6b0 100644
--- a/src/openvic-simulation/scripts/ConditionalWeight.hpp
+++ b/src/openvic-simulation/scripts/ConditionalWeight.hpp
@@ -42,6 +42,6 @@ namespace OpenVic {
NodeTools::node_callback_t expect_conditional_weight(base_key_t base_key);
- bool parse_scripts(GameManager const& game_manager);
+ bool parse_scripts(DefinitionManager const& definition_manager);
};
}
diff --git a/src/openvic-simulation/scripts/EffectScript.cpp b/src/openvic-simulation/scripts/EffectScript.cpp
index f51c053..fe8c240 100644
--- a/src/openvic-simulation/scripts/EffectScript.cpp
+++ b/src/openvic-simulation/scripts/EffectScript.cpp
@@ -2,7 +2,7 @@
using namespace OpenVic;
-bool EffectScript::_parse_script(ast::NodeCPtr root, GameManager& game_manager) {
+bool EffectScript::_parse_script(ast::NodeCPtr root, DefinitionManager const& definition_manager) {
// TODO - parse effect script
return true;
}
diff --git a/src/openvic-simulation/scripts/EffectScript.hpp b/src/openvic-simulation/scripts/EffectScript.hpp
index f5acf78..a7e88b6 100644
--- a/src/openvic-simulation/scripts/EffectScript.hpp
+++ b/src/openvic-simulation/scripts/EffectScript.hpp
@@ -3,10 +3,10 @@
#include "openvic-simulation/scripts/Script.hpp"
namespace OpenVic {
- struct GameManager;
+ struct DefinitionManager;
- struct EffectScript final : Script<GameManager&> {
+ struct EffectScript final : Script<DefinitionManager const&> {
protected:
- bool _parse_script(ast::NodeCPtr root, GameManager& game_manager) override;
+ bool _parse_script(ast::NodeCPtr root, DefinitionManager const& definition_manager) override;
};
}
diff --git a/src/openvic-simulation/scripts/Script.hpp b/src/openvic-simulation/scripts/Script.hpp
index 8efc277..82a14b8 100644
--- a/src/openvic-simulation/scripts/Script.hpp
+++ b/src/openvic-simulation/scripts/Script.hpp
@@ -3,6 +3,7 @@
#include "openvic-simulation/dataloader/NodeTools.hpp"
namespace OpenVic {
+ // TODO - is template needed if context is always DefinitionManager const&?
template<typename... _Context>
struct Script {
private: