Back to project page fireflies_android.
The source code is released under:
MIT License
If you think the Android project fireflies_android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package donothingbox.game.model; /*from ww w .ja v a 2 s .c o m*/ import java.util.Comparator; import donothingbox.game.view.*; /* * used to sort the Arraylist holding objects on the gameSurfaceView. * */ public class DepthSortComparator implements Comparator<Sprite> { public int compare(Sprite a, Sprite b) { if (a.depth < b.depth) return -1; if (a.depth == b.depth) { if (a.depth < b.depth) return -1; if (a.depth > b.depth) return 1; return 0; } return 1; } }