package com.ggj.game;

import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.utils.Array;
import com.ggj.model.Player;
import com.ggj.model.Rock;

public class ObjectController {
  public static synchronized int register(Actor actor) {
    objects.add(actor);
    
    return ++objectId;
  }
  
  public static <T> T getObject(Class<T> callee)
  {
    for(Actor actor : objects)
    {
      if(callee.equals(actor.getClass()))
      {
        return (T)actor;
      }
    }
    
    return null;
  }
  
  private static int objectId = 0;
  private static Array<Actor> objects = new Array<Actor>();
}

@@ -16,16 +16,68 @@
 .game;%0A%0A
+import java.util.ArrayList;%0Aimport java.util.List;%0A%0A
 import c
@@ -564,16 +564,276 @@
 %0A  %7D%0A  %0A
+  public static %3CT%3E List%3CT%3E getList(Class%3CT%3E callee)%0A  %7B%0A    List%3CT%3E result = new ArrayList%3CT%3E();%0A    for(Actor actor : objects)%0A    %7B%0A      if(callee.equals(actor.getClass()))%0A      %7B%0A        result.add((T)actor);%0A      %7D%0A    %7D%0A    %0A    return result;%0A  %7D%0A  %0A
   privat

Add generic way to get a list of objects by class