author | Medo <smaxein@googlemail.com> |
Tue, 17 Jul 2012 23:06:20 +0200 | |
changeset 7334 | 66a10ae88457 |
parent 7332 | 3f2e130f9715 |
child 7342 | 0e29eec2df5c |
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 { |
867e4fda496e
Hedgeroid: Layout experiments for the lobby page
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
6 |
public static final ByNameComparator nameComparator = new ByNameComparator(); |
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; |
867e4fda496e
Hedgeroid: Layout experiments for the lobby page
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
9 |
public final long playerId; |
867e4fda496e
Hedgeroid: Layout experiments for the lobby page
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
10 |
|
7332
3f2e130f9715
Hedgeroid: Chat and player list work now, but everything is very much WIP
Medo <smaxein@googlemail.com>
parents:
7330
diff
changeset
|
11 |
public Player(String name, long playerId) { |
7330
867e4fda496e
Hedgeroid: Layout experiments for the lobby page
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
12 |
this.name = name; |
867e4fda496e
Hedgeroid: Layout experiments for the lobby page
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
13 |
this.playerId = playerId; |
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 |
|
867e4fda496e
Hedgeroid: Layout experiments for the lobby page
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
16 |
private static class ByNameComparator implements Comparator<Player> { |
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 |
} |