v2.2.0: improved mobsprite sorting, more efficient & sorts other visuals

This commit is contained in:
Evan Debenham
2023-09-12 13:06:39 -04:00
parent 2cf30cacc7
commit 3e6ae53d2b
2 changed files with 13 additions and 7 deletions

View File

@@ -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;
}
}
}
}