E - type of the blackboard object that tasks use to read or modify game statepublic class Selector<E> extends SingleRunningChildBranch<E>
Selector is a branch task that runs every children until one of them succeeds. If a child task fails, the selector
will start and run the next child task.Task.StatuscurrentChildIndex, randomChildrenchildren| Constructor and Description |
|---|
Selector()
Creates a
Selector branch with no children. |
Selector(Array<Task<E>> tasks)
Creates a
Selector branch with the given children. |
Selector(Task<E>... tasks)
Creates a
Selector branch with the given children. |
| Modifier and Type | Method and Description |
|---|---|
void |
childFail(Task<E> runningTask)
This method will be called when one of the children of this task fails.
|
void |
childSuccess(Task<E> runningTask)
This method will be called when one of the children of this task succeeds.
|
cancelRunningChildren, childRunning, copyTo, createRandomChildren, reset, run, startaddChildToTask, getChild, getChildCountpublic Selector()
Selector branch with no children.public Selector(Task<E>... tasks)
Selector branch with the given children.tasks - the children of this taskpublic void childFail(Task<E> runningTask)
TaskchildFail in class SingleRunningChildBranch<E>runningTask - the task that failedpublic void childSuccess(Task<E> runningTask)
TaskchildSuccess in class SingleRunningChildBranch<E>runningTask - the task that succeededCopyright © 2018. All rights reserved.