1
1
import test from "ava" ;
2
- import * as TypeMoq from "typemoq" ;
3
2
import BehaviorTreeBuilder from "../src/BehaviorTreeBuilder" ;
4
3
import BehaviorTreeError from "../src/Error/BehaviorTreeError" ;
5
4
import BehaviorTreeStatus from "../src/BehaviorTreeStatus" ;
6
5
import InverterNode from "../src/Node/InverterNode" ;
7
- import TimeData from "../src/TimeData " ;
6
+ import StateData from "../src/StateData " ;
8
7
import SequenceNode from "../src/Node/SequenceNode" ;
9
8
import ParallelNode from "../src/Node/ParallelNode" ;
10
9
import SelectorNode from "../src/Node/SelectorNode" ;
@@ -41,7 +40,7 @@ test("can create inverter node", async (assert) => {
41
40
. build ( ) ;
42
41
43
42
assert . is ( InverterNode , node . constructor ) ;
44
- assert . is ( BehaviorTreeStatus . Failure , await node . tick ( new TimeData ( ) ) ) ;
43
+ assert . is ( BehaviorTreeStatus . Failure , await node . tick ( new StateData ( ) ) ) ;
45
44
} ) ;
46
45
47
46
test ( "can't create an unbalanced behavior tree" , async ( assert ) => {
@@ -63,7 +62,7 @@ test("condition is syntactic sugar for do", async (assert) => {
63
62
. build ( ) ;
64
63
65
64
assert . is ( InverterNode , node . constructor ) ;
66
- assert . is ( BehaviorTreeStatus . Failure , await node . tick ( new TimeData ( ) ) ) ;
65
+ assert . is ( BehaviorTreeStatus . Failure , await node . tick ( new StateData ( ) ) ) ;
67
66
} ) ;
68
67
69
68
test ( "can invert an inverter" , async ( assert ) => {
@@ -77,7 +76,7 @@ test("can invert an inverter", async (assert) => {
77
76
. build ( ) ;
78
77
79
78
assert . is ( InverterNode , node . constructor ) ;
80
- assert . is ( BehaviorTreeStatus . Success , await node . tick ( new TimeData ( ) ) ) ;
79
+ assert . is ( BehaviorTreeStatus . Success , await node . tick ( new StateData ( ) ) ) ;
81
80
} ) ;
82
81
83
82
test ( "adding more than a single child to inverter throws exception" , async ( assert ) => {
@@ -113,7 +112,7 @@ test("can create a sequence", async (assert) => {
113
112
. build ( ) ;
114
113
115
114
assert . is ( SequenceNode , sequence . constructor ) ;
116
- assert . is ( BehaviorTreeStatus . Success , await sequence . tick ( new TimeData ( ) ) ) ;
115
+ assert . is ( BehaviorTreeStatus . Success , await sequence . tick ( new StateData ( ) ) ) ;
117
116
assert . is ( 2 , invokeCount ) ;
118
117
} ) ;
119
118
@@ -136,7 +135,7 @@ test("can create a parallel", async (assert) => {
136
135
. build ( ) ;
137
136
138
137
assert . is ( ParallelNode , parallel . constructor ) ;
139
- assert . is ( BehaviorTreeStatus . Success , await parallel . tick ( new TimeData ( ) ) ) ;
138
+ assert . is ( BehaviorTreeStatus . Success , await parallel . tick ( new StateData ( ) ) ) ;
140
139
assert . is ( 2 , invokeCount ) ;
141
140
} ) ;
142
141
@@ -159,7 +158,7 @@ test("can create a selector", async (assert) => {
159
158
. build ( ) ;
160
159
161
160
assert . is ( SelectorNode , selector . constructor ) ;
162
- assert . is ( BehaviorTreeStatus . Success , await selector . tick ( new TimeData ( ) ) ) ;
161
+ assert . is ( BehaviorTreeStatus . Success , await selector . tick ( new StateData ( ) ) ) ;
163
162
assert . is ( 2 , invokeCount ) ;
164
163
} ) ;
165
164
@@ -183,7 +182,7 @@ test("can splice sub tree", async (assert) => {
183
182
. end ( )
184
183
. build ( ) ;
185
184
186
- await tree . tick ( new TimeData ) ;
185
+ await tree . tick ( new StateData ) ;
187
186
188
187
assert . is ( 2 , invokeCount ) ;
189
188
} ) ;
0 commit comments