project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/netplay/Player.java
equal
deleted
inserted
replaced
1 package org.hedgewars.hedgeroid.netplay; |
1 package org.hedgewars.hedgeroid.netplay; |
2 |
2 |
3 import java.util.Comparator; |
3 import java.util.Comparator; |
4 |
4 |
5 public class Player { |
5 public class Player { |
6 public static final ByNameComparator nameComparator = new ByNameComparator(); |
6 public static final ByNameComparator NAME_COMPARATOR = new ByNameComparator(); |
7 |
7 |
8 public final String name; |
8 public final String name; |
9 public final long id; // for ListView |
9 public final long id; // for ListView |
10 |
10 |
11 public Player(String name, long id) { |
11 public Player(String name, long id) { |
12 this.name = name; |
12 this.name = name; |
13 this.id = id; |
13 this.id = id; |
14 } |
14 } |
15 |
15 |
16 private static class ByNameComparator implements Comparator<Player> { |
16 private static final class ByNameComparator implements Comparator<Player> { |
17 public int compare(Player lhs, Player rhs) { |
17 public int compare(Player lhs, Player rhs) { |
18 return lhs.name.compareToIgnoreCase(rhs.name); |
18 return lhs.name.compareToIgnoreCase(rhs.name); |
19 } |
19 } |
20 } |
20 } |
21 } |
21 } |