SpiecsEngine
 
Loading...
Searching...
No Matches

◆ TEST() [1/59]

SpicesTest::TEST ( behave_state_list_test ,
All  )

Testing scl::behave_state_list.

Definition at line 17 of file BehaveStateList_test.h.

17 {
18
20
22
23 {
24 const auto node = list.AddNode();
25
26 node->PushBehave("B", []() {
27 std::cout << "BO" << std::endl;
28 });
29 }
30
31 {
32 const auto node = list.AddNode();
33
34 node->PushBehave("B", []() {
35 std::cout << "B1" << std::endl;
36 });
37 }
38
39 {
40 const auto node = list.AddNode();
41
42 node->PushBehave("B", []() {
43 std::cout << "B2" << std::endl;
44 });
45 }
46
47 for (int i = 0; i < 3; i++)
48 {
49 const auto node = list.GetState();
50
51 node->ExecuteBehave("B");
52
53 list.IncreateState();
54 }
55
56 }
#define SPICESTEST_PROFILE_FUNCTION()
behave_state_node< Ret, Args... > * AddNode()
Add a empty node to this list.
behave_state_node< Ret, Args... > * GetState() const
Get current state node.
void IncreateState()
Current State move forward.
behave_state_list. wrapper of combing all state behaves.
void ExecuteBehave(const std::string &name, Args... args)
Execute a behave in this state.
void PushBehave(const std::string &name, const std::function< Ret(Args...)> &fn)
Push a behave to this state.