Package org.terasology.logic.behavior.tree

Examples of org.terasology.logic.behavior.tree.Task


        });
        SelectorNode node = new SelectorNode();
        node.children().add(one);
        node.children().add(two);

        Task selector = interpreter.start(node);
        interpreter.tick(0);
        Assert.assertEquals(Status.RUNNING, selector.getStatus());
        interpreter.tick(0);
        Assert.assertEquals(Status.SUCCESS, selector.getStatus());
        verify(spies[0]).onTerminate(Status.SUCCESS);
        Assert.assertNull(spies[1]);
    }
View Full Code Here


        });
        SelectorNode node = new SelectorNode();
        node.children().add(one);
        node.children().add(two);

        Task selector = interpreter.start(node);
        interpreter.tick(0);
        Assert.assertEquals(Status.RUNNING, selector.getStatus());
        interpreter.tick(0);
        Assert.assertEquals(Status.RUNNING, selector.getStatus());
        interpreter.tick(0);
        Assert.assertEquals(Status.RUNNING, selector.getStatus());

        verify(spies[0]).onTerminate(Status.FAILURE);
        verify(spies[1]).onInitialize();
    }
View Full Code Here

            });
            SelectorNode node = new SelectorNode();

            node.children().add(mock);

            Task task = interpreter.start(node);
            interpreter.tick(0);
            Assert.assertEquals(Status.RUNNING, task.getStatus());
            interpreter.tick(0);
            Assert.assertEquals(status, task.getStatus());
            verify(spies[0]).onTerminate(status);
        }
    }
View Full Code Here

    private Node create(final Mocker mocker) {
        final Node node = new DebugNode(1);
        return new Node() {
            @Override
            public Task createTask() {
                Task spy = spy(new Task(null) {
                    @Override
                    public Status update(float dt) {
                        return null;
                    }
View Full Code Here

        });
        SequenceNode node = new SequenceNode();
        node.children().add(one);
        node.children().add(two);

        Task selector = interpreter.start(node);
        interpreter.tick(0);
        Assert.assertEquals(Status.RUNNING, selector.getStatus());
        interpreter.tick(0);
        Assert.assertEquals(Status.FAILURE, selector.getStatus());
        verify(spies[0]).onTerminate(Status.FAILURE);
        Assert.assertNull(spies[1]);
    }
View Full Code Here

        });
        SequenceNode node = new SequenceNode();
        node.children().add(one);
        node.children().add(two);

        Task selector = interpreter.start(node);
        interpreter.tick(0);
        Assert.assertEquals(Status.RUNNING, selector.getStatus());
        interpreter.tick(0);
        Assert.assertEquals(Status.RUNNING, selector.getStatus());
        interpreter.tick(0);
        Assert.assertEquals(Status.RUNNING, selector.getStatus());

        verify(spies[0]).onTerminate(Status.SUCCESS);
        verify(spies[1]).onInitialize();
    }
View Full Code Here

            });
            SequenceNode node = new SequenceNode();

            node.children().add(mock);

            Task task = interpreter.start(node);
            interpreter.tick(0);
            Assert.assertEquals(Status.RUNNING, task.getStatus());
            interpreter.tick(0);
            Assert.assertEquals(status, task.getStatus());
            verify(spies[0]).onTerminate(status);
        }
    }
View Full Code Here

    private Node create(final Mocker mocker) {
        final Node node = new DebugNode(1);
        return new Node() {
            @Override
            public Task createTask() {
                Task spy = spy(new Task(null) {
                    @Override
                    public Status update(float dt) {
                        return null;
                    }
View Full Code Here

TOP

Related Classes of org.terasology.logic.behavior.tree.Task

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.