T X 0 Report post Posted March 28, 2010 (edited) Just a random thought. public class Entity { public Entity(String name, int type, int x, int y) { setName(name).setType(type).setX(x).setY(y); } public String toString() { return "[Entity - " + getName() + "]: Type: " + getType() + " X: " + getX() + " Y: " + getY() + "."; } public int getType() { return type; } public int getX() { return absX; } public int getY() { return absY; } public String getName() { return name; } public Entity setX(int x) { this.absX = x; return this; } public Entity setY(int y) { this.absY = y; return this; } public Entity setType(int type) { this.type = type; return this; } public Entity setName(String name) { this.name = name; return this; } private int type; private int absX; private int absY; private String name;} import java.util.List;import java.util.concurrent.CopyOnWriteArrayList;public class EntityManager { public List<Entity> getEntities() { return myEntities; } private List<Entity> myEntities = new CopyOnWriteArrayList<Entity>();} public class EntityTest { public EntityTest() { getEntityManager().getEntities().add(player); for(Entity e: getEntityManager().getEntities()) { System.out.println(e.toString()); } } public static void main(String[] args) { new EntityTest(); } public EntityManager getEntityManager() { return entityManager; } private EntityManager entityManager = new EntityManager(); private Entity player = new Entity("Player", 0, 0, 0);} Tell me your thoughts! I just thought of this now so give me some credit . Edited March 28, 2010 by T X (see edit history) Share this post Link to post Share on other sites