use of org.terasology.engine.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);
}
use of org.terasology.engine.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);
assertEquals(result, actualStates);
assertEquals(executed, executeCalled);
}
Aggregations