@Test public void testGetObjects() { GameObject object1 = world.addObject(new Mutator<GameObject>() { @Override public void mutate(GameObject target) { target.setLeft(10); } }); GameObject object2 = world.addObject(new Mutator<GameObject>() { @Override public void mutate(GameObject target) { target.setLeft(30); } }); GameObject object3 = world.addObject(new Mutator<GameObject>() { @Override public void mutate(GameObject target) { target.setLeft(20); } }); Array<GameObject> sorted = world.getObjects(); assertThat(sorted).containsExactly(object1, object2, object3); }
public Array<GameObject> getObjects() { return getObjects(null, false); }
GameWorld { public Array<GameObject> getObjects() { return getObjects(null, false); } }
GameWorld { public Array<GameObject> getObjects() { return getObjects(null, false); } GameWorld();  GameWorld(int cacheSize); }
GameWorld { public Array<GameObject> getObjects() { return getObjects(null, false); } GameWorld();  GameWorld(int cacheSize); void setCamera(GameCamera gameCamera); void addListener(GameWorldListener listener); void removeListener(GameWorldListener listener); WorldBounds getBounds(); void setBounds(WorldBounds bounds); GameObject addObject(Object group); GameObject addObject(); GameObject addObject(Object group, boolean lazy); GameObject addObject(Mutator<GameObject> mutator, boolean lazy); GameObject addObject(boolean lazy); GameObject addObject(Mutator<GameObject> mutator); GameObject addObject(Object group, Mutator<GameObject> mutator); GameObject addObject(final Object group, Mutator<GameObject> mutator, boolean lazy); void update(float delta); GameObject getObjectById(String id); Array<GameObject> getObjects(); Array<GameObject> getObjects(Comparator<GameObject> comparator); Array<GameObject> getObjects(Comparator<GameObject> comparator, boolean updatableOnly); int size(); void clear(); void clearGroup(Object groupKey); Array<GameObject> getGroup(Object groupKey); void remove(final GameObject... objects); void remove(final String... ids); }
GameWorld { public Array<GameObject> getObjects() { return getObjects(null, false); } GameWorld();  GameWorld(int cacheSize); void setCamera(GameCamera gameCamera); void addListener(GameWorldListener listener); void removeListener(GameWorldListener listener); WorldBounds getBounds(); void setBounds(WorldBounds bounds); GameObject addObject(Object group); GameObject addObject(); GameObject addObject(Object group, boolean lazy); GameObject addObject(Mutator<GameObject> mutator, boolean lazy); GameObject addObject(boolean lazy); GameObject addObject(Mutator<GameObject> mutator); GameObject addObject(Object group, Mutator<GameObject> mutator); GameObject addObject(final Object group, Mutator<GameObject> mutator, boolean lazy); void update(float delta); GameObject getObjectById(String id); Array<GameObject> getObjects(); Array<GameObject> getObjects(Comparator<GameObject> comparator); Array<GameObject> getObjects(Comparator<GameObject> comparator, boolean updatableOnly); int size(); void clear(); void clearGroup(Object groupKey); Array<GameObject> getGroup(Object groupKey); void remove(final GameObject... objects); void remove(final String... ids); static final String DEFAULT_GROUP_ID; static final int DEFAULT_CACHE_SIZE; }