diff options
author | Hop311 <Hop3114@gmail.com> | 2024-06-13 18:59:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-13 18:59:47 +0200 |
commit | bfd539513af435564daf70f94f6cce146dd5c948 (patch) | |
tree | 7ba5a06714c267185dd3a59aabc6556a105c122f /src/openvic-simulation/testing | |
parent | 01a8f60aaca9784d814f4cb35a3fc4be86e1dd20 (diff) | |
parent | 4b39e77304094708d5c503b6a221386408cc4409 (diff) |
Merge pull request #165 from OpenVicProject/instance-definition-managers
Separated GameManager into Definition and Instance Managers
Diffstat (limited to 'src/openvic-simulation/testing')
9 files changed, 13 insertions, 13 deletions
diff --git a/src/openvic-simulation/testing/TestScript.hpp b/src/openvic-simulation/testing/TestScript.hpp index fdf23a5..f2e8d75 100644 --- a/src/openvic-simulation/testing/TestScript.hpp +++ b/src/openvic-simulation/testing/TestScript.hpp @@ -1,7 +1,7 @@ #pragma once #include <vector> -#include "openvic-simulation/GameManager.hpp" +#include "openvic-simulation/DefinitionManager.hpp" #include "openvic-simulation/testing/Requirement.hpp" namespace OpenVic { @@ -9,7 +9,7 @@ namespace OpenVic { class TestScript { std::vector<Requirement*> requirements = std::vector<Requirement*>(); - GameManager* PROPERTY_RW(game_manager); + DefinitionManager const* PROPERTY_RW(definition_manager); std::string PROPERTY(script_name); public: diff --git a/src/openvic-simulation/testing/Testing.cpp b/src/openvic-simulation/testing/Testing.cpp index da9dccf..07294b2 100644 --- a/src/openvic-simulation/testing/Testing.cpp +++ b/src/openvic-simulation/testing/Testing.cpp @@ -6,7 +6,7 @@ using namespace OpenVic; -Testing::Testing(GameManager* game_manager) { +Testing::Testing(DefinitionManager const& definition_manager) { // Constructor for the tests will add requirements // Then execute the script @@ -24,7 +24,7 @@ Testing::Testing(GameManager* game_manager) { test_scripts.push_back(a_006_politics_tests); for (auto test_script : test_scripts) { - test_script->set_game_manager(game_manager); + test_script->set_definition_manager(&definition_manager); } } diff --git a/src/openvic-simulation/testing/Testing.hpp b/src/openvic-simulation/testing/Testing.hpp index 18ade0a..6b45cc5 100644 --- a/src/openvic-simulation/testing/Testing.hpp +++ b/src/openvic-simulation/testing/Testing.hpp @@ -2,7 +2,7 @@ #include <iostream> #include <vector> -#include "openvic-simulation/GameManager.hpp" +#include "openvic-simulation/DefinitionManager.hpp" #include "openvic-simulation/testing/TestScript.hpp" #include "openvic-simulation/testing/test_scripts/A_001_file_tests.cpp" #include "openvic-simulation/testing/test_scripts/A_002_economy_tests.cpp" @@ -16,7 +16,7 @@ namespace OpenVic { class Testing { public: - Testing(GameManager* game_manager); + Testing(DefinitionManager const& definition_manager); ~Testing(); std::vector<TestScript*> test_scripts = std::vector<TestScript*>(); diff --git a/src/openvic-simulation/testing/test_scripts/A_001_file_tests.cpp b/src/openvic-simulation/testing/test_scripts/A_001_file_tests.cpp index 213da76..cc093e9 100644 --- a/src/openvic-simulation/testing/test_scripts/A_001_file_tests.cpp +++ b/src/openvic-simulation/testing/test_scripts/A_001_file_tests.cpp @@ -1,4 +1,4 @@ -#include "openvic-simulation/GameManager.hpp" +#include "openvic-simulation/DefinitionManager.hpp" #include "openvic-simulation/testing/TestScript.hpp" namespace OpenVic { diff --git a/src/openvic-simulation/testing/test_scripts/A_002_economy_tests.cpp b/src/openvic-simulation/testing/test_scripts/A_002_economy_tests.cpp index 357157e..165c7f8 100644 --- a/src/openvic-simulation/testing/test_scripts/A_002_economy_tests.cpp +++ b/src/openvic-simulation/testing/test_scripts/A_002_economy_tests.cpp @@ -1,4 +1,4 @@ -#include "openvic-simulation/GameManager.hpp" +#include "openvic-simulation/DefinitionManager.hpp" #include "openvic-simulation/testing/TestScript.hpp" namespace OpenVic { @@ -552,7 +552,7 @@ namespace OpenVic { void check_base_price(std::string identifier, std::string target_value, std::string req_name) { // Get string of base_price from goods manager - fixed_point_t base_price_fp = get_game_manager()->get_economy_manager().get_good_definition_manager() + fixed_point_t base_price_fp = get_definition_manager()->get_economy_manager().get_good_definition_manager() .get_good_definition_by_identifier(identifier)->get_base_price(); std::stringstream ss; // Use a single digit floating point of the value diff --git a/src/openvic-simulation/testing/test_scripts/A_003_military_unit_tests.cpp b/src/openvic-simulation/testing/test_scripts/A_003_military_unit_tests.cpp index b61abb4..90f9b8f 100644 --- a/src/openvic-simulation/testing/test_scripts/A_003_military_unit_tests.cpp +++ b/src/openvic-simulation/testing/test_scripts/A_003_military_unit_tests.cpp @@ -1,4 +1,4 @@ -#include "openvic-simulation/GameManager.hpp" +#include "openvic-simulation/DefinitionManager.hpp" #include "openvic-simulation/testing/TestScript.hpp" namespace OpenVic { diff --git a/src/openvic-simulation/testing/test_scripts/A_004_networking_tests.cpp b/src/openvic-simulation/testing/test_scripts/A_004_networking_tests.cpp index 984a3c2..0e577ac 100644 --- a/src/openvic-simulation/testing/test_scripts/A_004_networking_tests.cpp +++ b/src/openvic-simulation/testing/test_scripts/A_004_networking_tests.cpp @@ -1,4 +1,4 @@ -#include "openvic-simulation/GameManager.hpp" +#include "openvic-simulation/DefinitionManager.hpp" #include "openvic-simulation/testing/TestScript.hpp" namespace OpenVic { diff --git a/src/openvic-simulation/testing/test_scripts/A_005_nation_tests.cpp b/src/openvic-simulation/testing/test_scripts/A_005_nation_tests.cpp index bfa8a59..5dc6447 100644 --- a/src/openvic-simulation/testing/test_scripts/A_005_nation_tests.cpp +++ b/src/openvic-simulation/testing/test_scripts/A_005_nation_tests.cpp @@ -1,4 +1,4 @@ -#include "openvic-simulation/GameManager.hpp" +#include "openvic-simulation/DefinitionManager.hpp" #include "openvic-simulation/testing/TestScript.hpp" namespace OpenVic { diff --git a/src/openvic-simulation/testing/test_scripts/A_006_politics_tests.cpp b/src/openvic-simulation/testing/test_scripts/A_006_politics_tests.cpp index f9e93d9..674f1da 100644 --- a/src/openvic-simulation/testing/test_scripts/A_006_politics_tests.cpp +++ b/src/openvic-simulation/testing/test_scripts/A_006_politics_tests.cpp @@ -1,4 +1,4 @@ -#include "openvic-simulation/GameManager.hpp" +#include "openvic-simulation/DefinitionManager.hpp" #include "openvic-simulation/testing/TestScript.hpp" namespace OpenVic { |