E - type of the blackboard object that tasks use to read or modify game state@TaskConstraint(minChildren=0, maxChildren=0) public class Include<E> extends Decorator<E>
Include decorator grafts a subtree. When the subtree is grafted depends on the value of the lazy attribute:
at clone-time if is false, at run-time if is true.Task.Status| Modifier and Type | Field and Description |
|---|---|
boolean |
lazy
Optional task attribute indicating whether the subtree should be included at clone-time (
false, the default) or at
run-time (true). |
String |
subtree
Mandatory task attribute indicating the path of the subtree to include.
|
| Constructor and Description |
|---|
Include()
Creates a non-lazy
Include decorator without specifying the subtree. |
Include(String subtree)
Creates a non-lazy
Include decorator for the specified subtree. |
Include(String subtree,
boolean lazy)
Creates an eager or lazy
Include decorator for the specified subtree. |
| Modifier and Type | Method and Description |
|---|---|
Task<E> |
cloneTask()
Returns a clone of the referenced subtree if this
Import is eager; otherwise returns a clone of itself. |
protected Task<E> |
copyTo(Task<E> task)
Copies this
Include to the given task. |
void |
start()
The first call of this method lazily sets its child to the referenced subtree created through the
BehaviorTreeLibraryManager. |
addChildToTask, childFail, childRunning, childSuccess, getChild, getChildCount, runaddChild, cancel, cancelRunningChildren, checkGuard, end, fail, getEntity, getGuard, getStatus, reset, running, setControl, setGuard, successpublic String subtree
public boolean lazy
false, the default) or at
run-time (true).public Include()
Include decorator without specifying the subtree.public Include(String subtree)
Include decorator for the specified subtree.subtree - the subtree reference, usually a pathpublic Include(String subtree, boolean lazy)
Include decorator for the specified subtree.subtree - the subtree reference, usually a pathlazy - whether inclusion should happen at clone-time (false) or at run-time (true)public void start()
BehaviorTreeLibraryManager. Subsequent calls do nothing since the child has already been set. A
UnsupportedOperationException is thrown if this Include is eager.start in class Task<E>UnsupportedOperationException - if this Include is eagerpublic Task<E> cloneTask()
Import is eager; otherwise returns a clone of itself.Copyright © 2018. All rights reserved.