aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/GameManager.cpp
diff options
context:
space:
mode:
author CptAlanSmith <123112708+CptAlanSmith@users.noreply.github.com>2023-09-23 20:25:15 +0200
committer GitHub <noreply@github.com>2023-09-23 20:25:15 +0200
commit005a8026bb424779a146e00cc48621ff1d72b807 (patch)
treedde15211e31d861b61711bf6aebdeb8713393d53 /src/openvic-simulation/GameManager.cpp
parentebea2e473eefa3945508b0bf622a472b62d70d3b (diff)
Testing (#23)
* Fixes for building scons * Initial proof of concept auto-testing Shows how we can pull loaded data and display it back * Re-did headless Because hubert insisted it be done like this ;) * Auto-Testing Framework Basics * Requirements Calculations * Fix for messy merge (teach me to use merge tools) * Fixing up misc merge issues to fully reconcile with master changes * Re-added missing getters * Move of testing files due to folder reorgs * Use new accessors + int reading fix --------- Co-authored-by: Hop311 <hop3114@gmail.com>
Diffstat (limited to 'src/openvic-simulation/GameManager.cpp')
-rw-r--r--src/openvic-simulation/GameManager.cpp70
1 files changed, 66 insertions, 4 deletions
diff --git a/src/openvic-simulation/GameManager.cpp b/src/openvic-simulation/GameManager.cpp
index 5067a65..e314593 100644
--- a/src/openvic-simulation/GameManager.cpp
+++ b/src/openvic-simulation/GameManager.cpp
@@ -1,15 +1,77 @@
#include "GameManager.hpp"
#include "openvic-simulation/utility/Logger.hpp"
-#include "units/Unit.hpp"
using namespace OpenVic;
GameManager::GameManager(state_updated_func_t state_updated_callback)
- : unit_manager { good_manager },
- clock { [this]() { tick(); }, [this]() { update_state(); } },
+ : clock { [this]() { tick(); }, [this]() { update_state(); } },
state_updated { state_updated_callback } {}
+Map& GameManager::get_map() {
+ return map;
+}
+
+Map const& GameManager::get_map() const {
+ return map;
+}
+
+BuildingManager& GameManager::get_building_manager() {
+ return building_manager;
+}
+
+BuildingManager const& GameManager::get_building_manager() const {
+ return building_manager;
+}
+
+GoodManager& GameManager::get_good_manager() {
+ return good_manager;
+}
+
+GoodManager const& GameManager::get_good_manager() const {
+ return good_manager;
+}
+
+PopManager& GameManager::get_pop_manager() {
+ return pop_manager;
+}
+
+PopManager const& GameManager::get_pop_manager() const {
+ return pop_manager;
+}
+
+IdeologyManager& GameManager::get_ideology_manager() {
+ return ideology_manager;
+}
+
+IdeologyManager const& GameManager::get_ideology_manager() const {
+ return ideology_manager;
+}
+
+IssueManager& GameManager::get_issue_manager() {
+ return issue_manager;
+}
+
+IssueManager const& GameManager::get_issue_manager() const {
+ return issue_manager;
+}
+
+UnitManager& GameManager::get_unit_manager() {
+ return unit_manager;
+}
+
+UnitManager const& GameManager::get_unit_manager() const {
+ return unit_manager;
+}
+
+GameAdvancementHook& GameManager::get_clock() {
+ return clock;
+}
+
+GameAdvancementHook const& GameManager::get_clock() const {
+ return clock;
+}
+
void GameManager::set_needs_update() {
needs_update = true;
}
@@ -123,7 +185,7 @@ bool GameManager::load_hardcoded_defines() {
using building_type_t = std::tuple<std::string, Building::level_t, Timespan>;
const std::vector<building_type_t> building_types {
- { "building_fort", 4, 8 }, { "building_naval_base", 6, 15 }, { "building_railroad", 5, 10 }
+ { "building_fort", 4, 8 }, { "building_naval_base", 6, 15 }, { "building_railroad", 5, 10 } // Move this to building.hpp
};
for (building_type_t const& type : building_types)
ret &= building_manager.add_building_type(std::get<0>(type), std::get<1>(type), std::get<2>(type));