project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/netplay/Player.java
changeset 7330 867e4fda496e
child 7332 3f2e130f9715
equal deleted inserted replaced
7328:cd919a2ead4e 7330:867e4fda496e
       
     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 }