use of org.terasology.logic.behavior.core.BehaviorState in project Terasology by MovingBlocks.
the class CountCallsTest method assertBT.
public void assertBT(String tree, List<BehaviorState> result, List<Integer> executed, boolean step) {
BehaviorNode node = fromJson(tree);
node.construct(null);
List<BehaviorState> actualStates = Lists.newArrayList();
for (int i = 0; i < result.size(); i++) {
BehaviorState state = node.execute(null);
actualStates.add(state);
}
node.destruct(null);
Assert.assertEquals(result, actualStates);
Assert.assertEquals(executed, executeCalled);
}
use of org.terasology.logic.behavior.core.BehaviorState in project Terasology by MovingBlocks.
the class RenderableNode method onDraw.
@Override
public void onDraw(Canvas canvas) {
canvas.drawTexture(texture);
BehaviorState status = getState();
String text = getData().displayName + " " + (status != null ? status : "");
if (collapsed) {
text += "[+]";
}
canvas.drawText(text);
if (editor != null) {
canvas.addInteractionRegion(moveListener, getData().description);
}
portList.onDraw(canvas);
}
Aggregations