Search in sources :

Example 1 with BehaviorState

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);
}
Also used : BehaviorState(org.terasology.engine.logic.behavior.core.BehaviorState)

Example 2 with BehaviorState

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);
}
Also used : BehaviorState(org.terasology.engine.logic.behavior.core.BehaviorState) BehaviorNode(org.terasology.engine.logic.behavior.core.BehaviorNode)

Aggregations

BehaviorState (org.terasology.engine.logic.behavior.core.BehaviorState)2 BehaviorNode (org.terasology.engine.logic.behavior.core.BehaviorNode)1