Package org.terasology.logic.behavior.tree

Examples of org.terasology.logic.behavior.tree.ParallelNode.children()


            }
        });

        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);
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());
View Full Code Here

        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();
        tree.setRoot(sequence);
        tree.createRenderable();
        tree.layout(null);
View Full Code Here

        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();
        tree.setRoot(sequence);
        tree.createRenderable();
        tree.layout(null);
        return tree;
View Full Code Here

            @Override
            public void mock(Task spy) {
                when(spy.update(anyInt())).thenReturn(Status.RUNNING, Status.RUNNING, Status.SUCCESS);
            }
        });
        parallel.children().add(one);
        parallel.children().add(two);

        Task task = interpreter.start(parallel);
        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.RUNNING, Status.SUCCESS);
            }
        });
        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);
View Full Code Here

            @Override
            public void mock(Task spy) {
                when(spy.update(anyInt())).thenReturn(Status.RUNNING, Status.RUNNING);
            }
        });
        parallel.children().add(one);
        parallel.children().add(two);

        Task task = interpreter.start(parallel);
        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.RUNNING);
            }
        });
        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);
View Full Code Here

            @Override
            public void mock(Task spy) {
                when(spy.update(anyInt())).thenReturn(Status.RUNNING, Status.RUNNING, Status.FAILURE);
            }
        });
        parallel.children().add(one);
        parallel.children().add(two);

        Task task = interpreter.start(parallel);
        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.RUNNING, Status.FAILURE);
            }
        });
        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);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.