@Test public void testClearGroup() { world.addObject("asdf"); world.addObject("asdf"); GameObject object3 = world.addObject("asdf2"); GameObject object4 = world.addObject("asdf2"); world.clearGroup("asdf"); assertThat(world.getGroup("asdf")).isEmpty(); assertThat(world.getObjects()).containsExactlyInAnyOrder(object3, object4); }
public void clearGroup(Object groupKey) { Array<GameObject> group = objects.getGroup(groupKey); if (group != null) { group = new Array<GameObject>(group); for (int i = 0; i < group.size; i++) { removeInternally(group.get(i).getId()); } objects.clearGroup(groupKey); } }
GameWorld { public void clearGroup(Object groupKey) { Array<GameObject> group = objects.getGroup(groupKey); if (group != null) { group = new Array<GameObject>(group); for (int i = 0; i < group.size; i++) { removeInternally(group.get(i).getId()); } objects.clearGroup(groupKey); } } }
GameWorld { public void clearGroup(Object groupKey) { Array<GameObject> group = objects.getGroup(groupKey); if (group != null) { group = new Array<GameObject>(group); for (int i = 0; i < group.size; i++) { removeInternally(group.get(i).getId()); } objects.clearGroup(groupKey); } } GameWorld();  GameWorld(int cacheSize); }
GameWorld { public void clearGroup(Object groupKey) { Array<GameObject> group = objects.getGroup(groupKey); if (group != null) { group = new Array<GameObject>(group); for (int i = 0; i < group.size; i++) { removeInternally(group.get(i).getId()); } objects.clearGroup(groupKey); } } 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 void clearGroup(Object groupKey) { Array<GameObject> group = objects.getGroup(groupKey); if (group != null) { group = new Array<GameObject>(group); for (int i = 0; i < group.size; i++) { removeInternally(group.get(i).getId()); } objects.clearGroup(groupKey); } } 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; }