v2.2.0: improved mobsprite sorting, more efficient & sorts other visuals
This commit is contained in:
@@ -314,6 +314,12 @@ public class Group extends Gizmo {
|
||||
}
|
||||
|
||||
public synchronized void sort(Comparator c){
|
||||
Collections.sort(members, c);
|
||||
//only sort if we aren't already sorted
|
||||
for (int i=0; i < length-1; i++) {
|
||||
if (c.compare(members.get(i), members.get(i+1)) > 0) {
|
||||
Collections.sort(members, c);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user