author | Medo <smaxein@googlemail.com> |
Mon, 23 Jul 2012 00:17:06 +0200 | |
changeset 7352 | 641f11cdd319 |
parent 7342 | 0e29eec2df5c |
child 7358 | 57a508884052 |
permissions | -rw-r--r-- |
7330
867e4fda496e
Hedgeroid: Layout experiments for the lobby page
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
1 |
package org.hedgewars.hedgeroid.netplay; |
867e4fda496e
Hedgeroid: Layout experiments for the lobby page
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
2 |
|
867e4fda496e
Hedgeroid: Layout experiments for the lobby page
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
3 |
import java.util.Comparator; |
867e4fda496e
Hedgeroid: Layout experiments for the lobby page
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
4 |
|
867e4fda496e
Hedgeroid: Layout experiments for the lobby page
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
5 |
public class Player { |
7352
641f11cdd319
Hedgeroid: Reworked player and room lists, added menus, added playername query
Medo <smaxein@googlemail.com>
parents:
7342
diff
changeset
|
6 |
public static final ByNameComparator NAME_COMPARATOR = new ByNameComparator(); |
7330
867e4fda496e
Hedgeroid: Layout experiments for the lobby page
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
7 |
|
867e4fda496e
Hedgeroid: Layout experiments for the lobby page
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
8 |
public final String name; |
7342
0e29eec2df5c
Hedgeroid: Got the roomlist working... more or less.
Medo <smaxein@googlemail.com>
parents:
7332
diff
changeset
|
9 |
public final long id; // for ListView |
7330
867e4fda496e
Hedgeroid: Layout experiments for the lobby page
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
10 |
|
7342
0e29eec2df5c
Hedgeroid: Got the roomlist working... more or less.
Medo <smaxein@googlemail.com>
parents:
7332
diff
changeset
|
11 |
public Player(String name, long id) { |
7330
867e4fda496e
Hedgeroid: Layout experiments for the lobby page
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
12 |
this.name = name; |
7342
0e29eec2df5c
Hedgeroid: Got the roomlist working... more or less.
Medo <smaxein@googlemail.com>
parents:
7332
diff
changeset
|
13 |
this.id = id; |
7330
867e4fda496e
Hedgeroid: Layout experiments for the lobby page
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
14 |
} |
867e4fda496e
Hedgeroid: Layout experiments for the lobby page
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
15 |
|
7352
641f11cdd319
Hedgeroid: Reworked player and room lists, added menus, added playername query
Medo <smaxein@googlemail.com>
parents:
7342
diff
changeset
|
16 |
private static final class ByNameComparator implements Comparator<Player> { |
7330
867e4fda496e
Hedgeroid: Layout experiments for the lobby page
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
17 |
public int compare(Player lhs, Player rhs) { |
867e4fda496e
Hedgeroid: Layout experiments for the lobby page
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
18 |
return lhs.name.compareToIgnoreCase(rhs.name); |
867e4fda496e
Hedgeroid: Layout experiments for the lobby page
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
19 |
} |
867e4fda496e
Hedgeroid: Layout experiments for the lobby page
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
20 |
} |
867e4fda496e
Hedgeroid: Layout experiments for the lobby page
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
21 |
} |