예제 #1
0
 private static ActionAttachment obtain(CommonUpdatePriority updatePriority) {
   switch (updatePriority) {
     case IO:
       return PoolService.obtain(IoActionAttachment.class);
     case INPUT:
       return PoolService.obtain(InputActionAttachment.class);
     case LOGIC:
       return PoolService.obtain(LogicActionAttachment.class);
     case PHYSICS:
       return PoolService.obtain(PhysicsActionAttachment.class);
     case UPDATE:
       return PoolService.obtain(UpdateActionAttachment.class);
     case PRE_RENDER:
       return PoolService.obtain(PreRenderActionAttachment.class);
     case RENDER:
       return PoolService.obtain(RenderActionAttachment.class);
     case POST_RENDER:
       return PoolService.obtain(PostRenderActionAttachment.class);
     case CLEANUP:
       return PoolService.obtain(CleanupActionAttachment.class);
     default:
       throw new IllegalArgumentException("Unhandled updatePriority.");
   }
 }
예제 #2
0
 public <T extends SceneNodeComponent & Poolable> T newComponent(Class<T> componentType) {
   T component = PoolService.obtain(componentType);
   component.setParent(this);
   return component;
 }
예제 #3
0
 @Override
 public void reset() {
   PoolService.free(value);
   value = null;
   owner = null;
 }
예제 #4
0
 public SceneNode newChild(String name) {
   SceneNode node = PoolService.obtain(SceneNode.class);
   node.name = name;
   node.setParent(this);
   return node;
 }