public void sort (Array<Pixmap> pixmaps) { if (comparator == null) { comparator = new Comparator<Pixmap>() { public int compare (Pixmap o1, Pixmap o2) { return Math.max(o1.getWidth(), o1.getHeight()) - Math.max(o2.getWidth(), o2.getHeight()); } }; } pixmaps.sort(comparator); }
@Override public void sort (final Camera camera, final Array<Renderable> renderables) { this.camera = camera; renderables.sort(this); }
/** Sort the attributes by their ID */ public final void sort () { if (!sorted) { attributes.sort(this); sorted = true; } }
/** Sort the attributes by their ID */ public final void sort () { if (!sorted) { attributes.sort(this); sorted = true; } }
public void sort (Array<Pixmap> pixmaps) { if (comparator == null) { comparator = new Comparator<Pixmap>() { public int compare (Pixmap o1, Pixmap o2) { return Math.max(o1.getWidth(), o1.getHeight()) - Math.max(o2.getWidth(), o2.getHeight()); } }; } pixmaps.sort(comparator); }
public void sort (Array<Pixmap> images) { if (comparator == null) { comparator = new Comparator<Pixmap>() { public int compare (Pixmap o1, Pixmap o2) { return o1.getHeight() - o2.getHeight(); } }; } images.sort(comparator); }
public void sort (Array<Pixmap> images) { if (comparator == null) { comparator = new Comparator<Pixmap>() { public int compare (Pixmap o1, Pixmap o2) { return o1.getHeight() - o2.getHeight(); } }; } images.sort(comparator); }
@Override public void sort (final Camera camera, final Array<Renderable> renderables) { this.camera = camera; renderables.sort(this); }
@Override public void sort (Camera camera, Array<Renderable> renderables) { renderables.sort(this); }
@Override public void sort (Camera camera, Array<Renderable> renderables) { renderables.sort(this); }
public void sort (Comparator<? super T> comparator) { if (iterating > 0) throw new IllegalStateException("Invalid between begin/end."); super.sort(comparator); }
public void sort (Comparator<? super T> comparator) { if (iterating > 0) throw new IllegalStateException("Invalid between begin/end."); super.sort(comparator); }
public void sort () { if (iterating > 0) throw new IllegalStateException("Invalid between begin/end."); super.sort(); }
public void sort () { if (iterating > 0) throw new IllegalStateException("Invalid between begin/end."); super.sort(); }
public void sort () { modified(); super.sort(); }
public void sort (Comparator<? super T> comparator) { modified(); super.sort(comparator); }
public void sort () { modified(); super.sort(); }
public void sort (Comparator<? super T> comparator) { modified(); super.sort(comparator); }
public static void verifyCorrectness (Dummy d, int k) { enemy.sort(distComp); int idx = enemy.indexOf(d, true); // remember that k = min value = 0 position in the array, therefore k - 1 if (enemy.get(idx) != enemy.get(k - 1)) { System.out.println("origin dummy: " + originDummy); System.out.println("TEST FAILURE: " + "idx: " + idx + " does not equal (k - 1): " + (k - 1)); throw new GdxRuntimeException("test failed"); } }
@Override public void render () { Gdx.gl.glClearColor(0.2f, 0.2f, 0.2f, 1); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); // sort the sprites (not necessary if we know // the are already sorted). sprites.sort(comparator); // draw the sprites batch.begin(); for (MySprite sprite : sprites) { sprite.draw(batch); } batch.end(); }