diff --git a/libs/BehaviorKit/include/BehaviorKit.h b/libs/BehaviorKit/include/BehaviorKit.h index 30be72fe96..4de8db6677 100644 --- a/libs/BehaviorKit/include/BehaviorKit.h +++ b/libs/BehaviorKit/include/BehaviorKit.h @@ -8,7 +8,6 @@ #include "interface/Behavior.h" #include "interface/libs/BehaviorKit.h" -#include "interface/libs/EventLoop.h" #include "internal/BehaviorID.h" namespace leka { @@ -16,7 +15,7 @@ namespace leka { class BehaviorKit : public interface::BehaviorKit { public: - explicit BehaviorKit(interface::EventLoop &event_loop); + explicit BehaviorKit() = default; void registerBehaviors(std::span behaviors) final; @@ -25,10 +24,6 @@ class BehaviorKit : public interface::BehaviorKit void stop() final; private: - void run(); - - interface::EventLoop &_event_loop; - std::span _behaviors {}; interface::Behavior *_behavior = nullptr; }; diff --git a/libs/BehaviorKit/source/BehaviorKit.cpp b/libs/BehaviorKit/source/BehaviorKit.cpp index 926159142f..7d3d263072 100644 --- a/libs/BehaviorKit/source/BehaviorKit.cpp +++ b/libs/BehaviorKit/source/BehaviorKit.cpp @@ -7,11 +7,6 @@ using namespace leka; -BehaviorKit::BehaviorKit(interface::EventLoop &event_loop) : _event_loop(event_loop) -{ - _event_loop.registerCallback([this] { run(); }); -} - void BehaviorKit::registerBehaviors(std::span behaviors) { _behaviors = behaviors; @@ -32,7 +27,7 @@ void BehaviorKit::start(interface::Behavior *behavior) return; } - _event_loop.start(); + _behavior->run(); } void BehaviorKit::start(BehaviorID id) @@ -49,11 +44,6 @@ void BehaviorKit::start(BehaviorID id) start(found_behavior); } -void BehaviorKit::run() -{ - _behavior->run(); -} - void BehaviorKit::stop() { if (_behavior != nullptr) { diff --git a/libs/BehaviorKit/tests/BehaviorKit_test.cpp b/libs/BehaviorKit/tests/BehaviorKit_test.cpp index 70b0d402be..2c1d7bfe29 100644 --- a/libs/BehaviorKit/tests/BehaviorKit_test.cpp +++ b/libs/BehaviorKit/tests/BehaviorKit_test.cpp @@ -7,7 +7,6 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" #include "mocks/leka/Behavior.h" -#include "stubs/leka/EventLoopKit.h" using namespace leka; @@ -21,8 +20,7 @@ class BehaviorKitTest : public ::testing::Test // void SetUp() override {} // void TearDown() override {} - stub::EventLoopKit stub_event_loop {}; - BehaviorKit behaviorkit {stub_event_loop}; + BehaviorKit behaviorkit {}; mock::Behavior mock_behavior_a {}; mock::Behavior mock_behavior_b {};