E - type of the blackboard object that tasks use to read or modify game statepublic abstract class LoopDecorator<E> extends Decorator<E>
LoopDecorator is an abstract class providing basic functionalities for concrete looping decorators.Task.Status| Modifier and Type | Field and Description |
|---|---|
protected boolean |
loop
Whether the
run() method must keep looping or not. |
| Constructor and Description |
|---|
LoopDecorator()
Creates a loop decorator with no child task.
|
LoopDecorator(Task<E> child)
Creates a loop decorator that wraps the given task.
|
| Modifier and Type | Method and Description |
|---|---|
void |
childRunning(Task<E> runningTask,
Task<E> reporter)
This method will be called when one of the ancestors of this task needs to run again.
|
boolean |
condition()
Whether the
run() method must keep looping or not. |
void |
run()
This method contains the update logic of this task.
|
addChildToTask, childFail, childSuccess, copyTo, getChild, getChildCountprotected boolean loop
run() method must keep looping or not.public LoopDecorator()
public boolean condition()
run() method must keep looping or not.true if it must keep looping; false otherwise.public void run()
TaskTask.running(),
Task.success() or Task.fail() exactly once.public void childRunning(Task<E> runningTask, Task<E> reporter)
TaskchildRunning in class Decorator<E>runningTask - the task that needs to run againreporter - the task that reports, usually one of this task's childrenCopyright © 2017. All rights reserved.