Package org.terasology.logic.behavior.tree

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


            public void mock(Task spy) {
                when(spy.update(anyInt())).thenReturn(Status.SUCCESS);
            }
        }));

        Task task = interpreter.start(repeat);
        interpreter.tick(0);
        Assert.assertEquals(Status.RUNNING, task.getStatus());
        interpreter.tick(0);
        Assert.assertEquals(Status.RUNNING, task.getStatus());
        interpreter.tick(0);
        Assert.assertEquals(Status.RUNNING, task.getStatus());
        interpreter.tick(0);
        Assert.assertEquals(Status.RUNNING, task.getStatus());
        interpreter.tick(0);
        Assert.assertEquals(Status.RUNNING, task.getStatus());
    }
View Full Code Here


            public void mock(Task spy) {
                when(spy.update(anyInt())).thenReturn(Status.RUNNING, Status.SUCCESS);
            }
        }));

        Task task = interpreter.start(repeat);
        interpreter.tick(0);
        Assert.assertEquals(Status.RUNNING, task.getStatus());
        interpreter.tick(0);
        Assert.assertEquals(Status.RUNNING, task.getStatus());
        interpreter.tick(0);
        Assert.assertEquals(Status.RUNNING, task.getStatus());
        interpreter.tick(0);
        Assert.assertEquals(Status.RUNNING, task.getStatus());
    }
View Full Code Here

        ParallelNode move = new ParallelNode(ParallelNode.Policy.RequireOne, ParallelNode.Policy.RequireOne);

        move.children().add(new DebugNode(3));
        move.children().add(mock);
        Task task = interpreter.start(move);
        interpreter.tick(0);
        Assert.assertEquals(Status.RUNNING, task.getStatus());
        interpreter.tick(0);
        Assert.assertEquals(Status.RUNNING, task.getStatus());
        interpreter.tick(0);
        Assert.assertEquals(Status.RUNNING, task.getStatus());
        interpreter.tick(0);
        Assert.assertEquals(Status.SUCCESS, task.getStatus());
    }
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

            }
        });
        parallel.children().add(one);
        parallel.children().add(two);

        Task task = interpreter.start(parallel);
        interpreter.tick(0);
        Assert.assertEquals(Status.RUNNING, task.getStatus());
        interpreter.tick(0);
        Assert.assertEquals(Status.RUNNING, task.getStatus());
        interpreter.tick(0);
        Assert.assertEquals(Status.SUCCESS, task.getStatus());
    }
View Full Code Here

            }
        });
        parallel.children().add(one);
        parallel.children().add(two);

        Task task = interpreter.start(parallel);
        interpreter.tick(0);
        Assert.assertEquals(Status.RUNNING, task.getStatus());
        interpreter.tick(0);
        Assert.assertEquals(Status.SUCCESS, task.getStatus());
    }
View Full Code Here

            }
        });
        parallel.children().add(one);
        parallel.children().add(two);

        Task task = interpreter.start(parallel);
        interpreter.tick(0);
        Assert.assertEquals(Status.RUNNING, task.getStatus());
        interpreter.tick(0);
        Assert.assertEquals(Status.RUNNING, task.getStatus());
        interpreter.tick(0);
        Assert.assertEquals(Status.FAILURE, task.getStatus());
    }
View Full Code Here

            }
        });
        parallel.children().add(one);
        parallel.children().add(two);

        Task task = interpreter.start(parallel);
        interpreter.tick(0);
        Assert.assertEquals(Status.RUNNING, task.getStatus());
        interpreter.tick(0);
        Assert.assertEquals(Status.FAILURE, task.getStatus());
    }
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

    private void create() {
        node = new Node() {
            @Override
            public Task createTask() {
                task = spy(new Task(null) {
                    @Override
                    public Status update(float dt) {
                        return result;
                    }
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.