Package org.terasology.logic.behavior.tree

Examples of org.terasology.logic.behavior.tree.RepeatNode$RepeatTask


public class RepeatTest {
    @Test
    public void test0() {
        Interpreter interpreter = new Interpreter(null);
        DebugNode debugNode = new DebugNode(0);
        RepeatNode repeatNode = new RepeatNode(debugNode);
        interpreter.start(repeatNode);

        Assert.assertTrue(interpreter.tick(0) > 0);
        DebugNode.DebugTask first = debugNode.lastTask2;
        Assert.assertTrue(first.updateCalled);
View Full Code Here


    @Test
    public void test1() {
        Interpreter interpreter = new Interpreter(null);
        DebugNode debugNode = new DebugNode(1);
        RepeatNode repeatNode = new RepeatNode(debugNode);

        interpreter.start(repeatNode);

        Assert.assertTrue(interpreter.tick(0) > 0);
        DebugNode.DebugTask first = debugNode.lastTask;
View Full Code Here

    }

    @Test
    public void testRepeatEndless() {
        Interpreter interpreter = new Interpreter(null);
        RepeatNode repeat = new RepeatNode(create(new Mocker() {
            @Override
            public void mock(Task spy) {
                when(spy.update(anyInt())).thenReturn(Status.SUCCESS);
            }
        }));
View Full Code Here

    }

    @Test
    public void testRepeat() {
        Interpreter interpreter = new Interpreter(null);
        RepeatNode repeat = new RepeatNode(create(new Mocker() {
            @Override
            public void mock(Task spy) {
                when(spy.update(anyInt())).thenReturn(Status.RUNNING, Status.SUCCESS);
            }
        }));
View Full Code Here

    }

    private BehaviorTreeData buildSample() {
        SequenceNode sequence = new SequenceNode();
        sequence.children().add(new DebugNode(1));
        sequence.children().add(new RepeatNode(new DebugNode(2)));
        ParallelNode parallel = new ParallelNode(ParallelNode.Policy.RequireAll, ParallelNode.Policy.RequireAll);
        sequence.children().add(parallel);
        parallel.children().add(new MonitorNode());
        parallel.children().add(new DebugNode(3));
        BehaviorTreeData tree = new BehaviorTreeData();
View Full Code Here

TOP

Related Classes of org.terasology.logic.behavior.tree.RepeatNode$RepeatTask

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.