public class PooledBehaviorTreeLibrary extends BehaviorTreeLibrary
BehaviorTreeLibrary using reference pool.
BehaviorTree created by PooledBehaviorTreeLibrary should be disposed by
calling BehaviorTreeLibrary.disposeBehaviorTree(String, BehaviorTree).| Modifier and Type | Field and Description |
|---|---|
protected org.mini2Dx.gdx.utils.ObjectMap<java.lang.String,org.mini2Dx.gdx.utils.Pool<BehaviorTree>> |
pools |
parser, repository, resolver| Constructor and Description |
|---|
PooledBehaviorTreeLibrary() |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
clear all pools.
|
void |
clear(java.lang.String treeReference)
Clear pool for a tree reference.
|
<T> BehaviorTree<T> |
createBehaviorTree(java.lang.String treeReference,
T blackboard)
Creates the
BehaviorTree for the specified reference and blackboard object. |
void |
disposeBehaviorTree(java.lang.String treeReference,
BehaviorTree<?> behaviorTree)
Dispose behavior tree obtain by this library.
|
protected org.mini2Dx.gdx.utils.Pool<BehaviorTree> |
getPool(java.lang.String treeReference)
retrieve pool by tree reference, create it if not already exists.
|
protected <T> BehaviorTree<T> |
newBehaviorTree(java.lang.String treeReference)
creates concrete tree instance.
|
createBehaviorTree, createRootTask, hasArchetypeTree, registerArchetypeTree, retrieveArchetypeTreeprotected org.mini2Dx.gdx.utils.ObjectMap<java.lang.String,org.mini2Dx.gdx.utils.Pool<BehaviorTree>> pools
protected org.mini2Dx.gdx.utils.Pool<BehaviorTree> getPool(java.lang.String treeReference)
treeReference - protected <T> BehaviorTree<T> newBehaviorTree(java.lang.String treeReference)
treeReference - public <T> BehaviorTree<T> createBehaviorTree(java.lang.String treeReference, T blackboard)
BehaviorTreeLibraryBehaviorTree for the specified reference and blackboard object.createBehaviorTree in class BehaviorTreeLibrarytreeReference - the tree identifier, typically a pathblackboard - the blackboard object (it can be null).public void disposeBehaviorTree(java.lang.String treeReference,
BehaviorTree<?> behaviorTree)
BehaviorTreeLibrarydisposeBehaviorTree in class BehaviorTreeLibrarytreeReference - the tree identifier.behaviorTree - the tree to dispose.public void clear(java.lang.String treeReference)
treeReference - public void clear()