protected Pool < BehaviorTree > getPool ( final String treeReference ) { Pool < BehaviorTree > treePool = pools . get ( treeReference ) ; if ( treePool == null ) { treePool = new Pool < BehaviorTree > ( ) { @ Override protected BehaviorTree newObject ( ) { return newBehaviorTree ( treeReference ) ; } } ; pools . put ( treeReference , treePool ) ; } return treePool ; }
retrieve pool by tree reference create it if not already exists .