project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Player.java
equal
deleted
inserted
replaced
38 public String toString() { |
38 public String toString() { |
39 return "Player [name=" + name + ", registered=" + registered |
39 return "Player [name=" + name + ", registered=" + registered |
40 + ", admin=" + admin + "]"; |
40 + ", admin=" + admin + "]"; |
41 } |
41 } |
42 |
42 |
43 public static Comparator<Player> NAME_ORDER = new Comparator<Player>() { |
43 public static Comparator<Player> ADMIN_NAME_ORDER = new Comparator<Player>() { |
44 public int compare(Player lhs, Player rhs) { |
44 public int compare(Player lhs, Player rhs) { |
45 return lhs.name.compareToIgnoreCase(rhs.name); |
45 if(lhs.admin != rhs.admin) { |
|
46 return lhs.admin ? -1 : 1; |
|
47 } else { |
|
48 return lhs.name.compareToIgnoreCase(rhs.name); |
|
49 } |
46 } |
50 } |
47 }; |
51 }; |
48 } |
52 } |