diff options
author | max-001 <maxsmits21@kpnmail.nl> | 2024-12-05 17:26:41 +0100 |
---|---|---|
committer | max-001 <maxsmits21@kpnmail.nl> | 2024-12-05 17:26:41 +0100 |
commit | e617b4f002638e37dbe4d2ce13849728e7e82c78 (patch) | |
tree | 8b3bc87b97623043d07eaa40510454209955f1c9 /src/crepe/system | |
parent | 0b942f4d6eb87fb623afbbae617478674c612ccc (diff) |
Used Mediator
Diffstat (limited to 'src/crepe/system')
-rw-r--r-- | src/crepe/system/AISystem.cpp | 9 |
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(); |