project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/netplay/Player.java
author Medo <smaxein@googlemail.com>
Mon, 16 Jul 2012 20:16:03 +0200
changeset 7330 867e4fda496e
child 7332 3f2e130f9715
permissions -rw-r--r--
Hedgeroid: Layout experiments for the lobby page

package org.hedgewars.hedgeroid.netplay;

import java.util.Comparator;

public class Player {
	public static final ByNameComparator nameComparator = new ByNameComparator(); 

	public final String name;
	public final long playerId;
	public final boolean friend;
	public final boolean ignored;
	
	public Player(String name, long playerId, boolean friend, boolean ignored) {
		super();
		this.name = name;
		this.playerId = playerId;
		this.friend = friend;
		this.ignored = ignored;
	}
	
	private static class ByNameComparator implements Comparator<Player> {
		public int compare(Player lhs, Player rhs) {
			return lhs.name.compareToIgnoreCase(rhs.name);
		}
	}
}