public final class BehaviorTreeLibraryManager extends Object
BehaviorTreeLibraryManager
is a singleton in charge of the creation of behavior trees using the underlying library.
If no library is explicitly set (see the method setLibrary(BehaviorTreeLibrary)
), a default library instantiated by
the constructor BehaviorTreeLibrary()
is used instead.Modifier and Type | Field and Description |
---|---|
protected BehaviorTreeLibrary |
library |
Modifier and Type | Method and Description |
---|---|
<T> BehaviorTree<T> |
createBehaviorTree(String treeReference)
Creates the
BehaviorTree for the specified reference. |
<T> BehaviorTree<T> |
createBehaviorTree(String treeReference,
T blackboard)
Creates the
BehaviorTree for the specified reference and blackboard object. |
<T> Task<T> |
createRootTask(String treeReference)
Creates the root task of
BehaviorTree for the specified reference. |
static BehaviorTreeLibraryManager |
getInstance()
Returns the singleton instance of the
BehaviorTreeLibraryManager . |
BehaviorTreeLibrary |
getLibrary()
Gets the the behavior tree library
|
void |
setLibrary(BehaviorTreeLibrary library)
Sets the the behavior tree library
|
protected BehaviorTreeLibrary library
public static BehaviorTreeLibraryManager getInstance()
BehaviorTreeLibraryManager
.public BehaviorTreeLibrary getLibrary()
public void setLibrary(BehaviorTreeLibrary library)
library
- the behavior tree library to setpublic <T> Task<T> createRootTask(String treeReference)
BehaviorTree
for the specified reference.treeReference
- the tree identifier, typically a pathRuntimeException
- if the reference cannot be successfully parsed.TaskCloneException
- if the archetype cannot be successfully parsed.public <T> BehaviorTree<T> createBehaviorTree(String treeReference)
BehaviorTree
for the specified reference.treeReference
- the tree identifier, typically a pathRuntimeException
- if the reference cannot be successfully parsed.TaskCloneException
- if the archetype cannot be successfully parsed.public <T> BehaviorTree<T> createBehaviorTree(String treeReference, T blackboard)
BehaviorTree
for the specified reference and blackboard object.treeReference
- the tree identifier, typically a pathblackboard
- the blackboard object (it can be null
).RuntimeException
- if the reference cannot be successfully parsed.TaskCloneException
- if the archetype cannot be successfully parsed.Copyright © 2018. All rights reserved.