package net.mueller_martin.turirun;

import java.util.HashMap;
import java.util.ArrayList;
import net.mueller_martin.turirun.gameobjects.GameObject;

/**
 * Created by DM on 06.11.15.
 */
public class ObjectController {
	private ArrayList<GameObject> objs = new ArrayList<GameObject>();

	public void addObject(GameObject obj) {
		objs.add(obj);
	}

	public void removeObject(GameObject obj) {
		objs.remove(obj);
	}

	public ArrayList<GameObject> getObjects() {
		return objs;
	}
}

@@ -212,16 +212,133 @@
 roller %7B
+%0A%0A%09private static int next_id = 0;%0A%09private HashMap%3CInteger,GameObject%3E objs_map = new HashMap%3CInteger,GameObject%3E();
 %0A%09privat
@@ -435,24 +435,111 @@
 ject obj) %7B%0A
+%09%09this.next_id++;%0A%09%09%0A%09%09int id = next_id;%0A%09%09obj.id = next_id;%0A%0A%09%09objs_map.put(id, obj);%0A
 %09%09objs.add(o
@@ -591,16 +591,43 @@
  obj) %7B%0A
+%09%09objs_map.remove(obj.id);%0A
 %09%09objs.r
@@ -687,16 +687,16 @@
 cts() %7B%0A
-
 %09%09return
@@ -704,11 +704,81 @@
 objs;%0A%09%7D
+%0A%0A%09public GameObject getObject(int id) %7B%0A%09%09return objs_map.get(id);%0A%09%7D
 %0A%7D%0A

Revert "Remove id attributes from ObjectController"