aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/system
diff options
context:
space:
mode:
Diffstat (limited to 'src/crepe/system')
-rw-r--r--src/crepe/system/AISystem.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/crepe/system/AISystem.cpp b/src/crepe/system/AISystem.cpp
index 9029f32..c67d5ea 100644
--- a/src/crepe/system/AISystem.cpp
+++ b/src/crepe/system/AISystem.cpp
@@ -1,6 +1,7 @@
-#include "../ComponentManager.h"
+#include "manager/ComponentManager.h"
#include "api/LoopTimer.h"
#include "api/Transform.h"
+#include "manager/Mediator.h"
#include "types.h"
#include "AISystem.h"
@@ -8,7 +9,8 @@
using namespace crepe;
void AISystem::update() {
- ComponentManager & mgr = this->component_manager;
+ const Mediator & mediator = this->mediator;
+ ComponentManager & mgr = mediator.component_manager;
RefVector<AI> ai_components = mgr.get_components_by_type<AI>();
double dt = LoopTimer::get_instance().get_delta_time();
@@ -63,7 +65,8 @@ bool AISystem::accumulate_force(vec2 & running_total, vec2 force_to_add) {
}
vec2 AISystem::seek(const AI & ai) {
- ComponentManager & mgr = this->component_manager;
+ const Mediator & mediator = this->mediator;
+ ComponentManager & mgr = mediator.component_manager;
RefVector<Transform> transforms = mgr.get_components_by_id<Transform>(ai.game_object_id);
Transform & transform = transforms.front().get();