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.");
   }
 }
Exemple #2
0
 public <T extends SceneNodeComponent & Poolable> T newComponent(Class<T> componentType) {
   T component = PoolService.obtain(componentType);
   component.setParent(this);
   return component;
 }
 @Override
 public void reset() {
   PoolService.free(value);
   value = null;
   owner = null;
 }
Exemple #4
0
 public SceneNode newChild(String name) {
   SceneNode node = PoolService.obtain(SceneNode.class);
   node.name = name;
   node.setParent(this);
   return node;
 }