project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/netplay/Player.java
changeset 7352 641f11cdd319
parent 7342 0e29eec2df5c
child 7358 57a508884052
equal deleted inserted replaced
7349:12fdfd2038d4 7352:641f11cdd319
     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 }