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