File tree Expand file tree Collapse file tree 3 files changed +3
-20
lines changed Expand file tree Collapse file tree 3 files changed +3
-20
lines changed Original file line number Diff line number Diff line change 8
8
9
9
#include " interface/Behavior.h"
10
10
#include " interface/libs/BehaviorKit.h"
11
- #include " interface/libs/EventLoop.h"
12
11
#include " internal/BehaviorID.h"
13
12
14
13
namespace leka {
15
14
16
15
class BehaviorKit : public interface ::BehaviorKit
17
16
{
18
17
public:
19
- explicit BehaviorKit (interface::EventLoop &event_loop) ;
18
+ explicit BehaviorKit () = default ;
20
19
21
20
void registerBehaviors (std::span<interface::Behavior *> behaviors) final ;
22
21
@@ -25,10 +24,6 @@ class BehaviorKit : public interface::BehaviorKit
25
24
void stop () final ;
26
25
27
26
private:
28
- void run ();
29
-
30
- interface::EventLoop &_event_loop;
31
-
32
27
std::span<interface::Behavior *> _behaviors {};
33
28
interface::Behavior *_behavior = nullptr ;
34
29
};
Original file line number Diff line number Diff line change 7
7
8
8
using namespace leka ;
9
9
10
- BehaviorKit::BehaviorKit (interface::EventLoop &event_loop) : _event_loop(event_loop)
11
- {
12
- _event_loop.registerCallback ([this ] { run (); });
13
- }
14
-
15
10
void BehaviorKit::registerBehaviors (std::span<interface::Behavior *> behaviors)
16
11
{
17
12
_behaviors = behaviors;
@@ -32,7 +27,7 @@ void BehaviorKit::start(interface::Behavior *behavior)
32
27
return ;
33
28
}
34
29
35
- _event_loop. start ();
30
+ _behavior-> run ();
36
31
}
37
32
38
33
void BehaviorKit::start (BehaviorID id)
@@ -49,11 +44,6 @@ void BehaviorKit::start(BehaviorID id)
49
44
start (found_behavior);
50
45
}
51
46
52
- void BehaviorKit::run ()
53
- {
54
- _behavior->run ();
55
- }
56
-
57
47
void BehaviorKit::stop ()
58
48
{
59
49
if (_behavior != nullptr ) {
Original file line number Diff line number Diff line change 7
7
#include " gmock/gmock.h"
8
8
#include " gtest/gtest.h"
9
9
#include " mocks/leka/Behavior.h"
10
- #include " stubs/leka/EventLoopKit.h"
11
10
12
11
using namespace leka ;
13
12
@@ -21,8 +20,7 @@ class BehaviorKitTest : public ::testing::Test
21
20
// void SetUp() override {}
22
21
// void TearDown() override {}
23
22
24
- stub::EventLoopKit stub_event_loop {};
25
- BehaviorKit behaviorkit {stub_event_loop};
23
+ BehaviorKit behaviorkit {};
26
24
27
25
mock::Behavior mock_behavior_a {};
28
26
mock::Behavior mock_behavior_b {};
You can’t perform that action at this time.
0 commit comments