project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/netplay/Player.java
author Medo <smaxein@googlemail.com>
Sat, 21 Jul 2012 14:56:52 +0200
changeset 7349 12fdfd2038d4
parent 7342 0e29eec2df5c
child 7352 641f11cdd319
permissions -rw-r--r--
Hedgeroid: More work on the lobby activity
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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;
7342
0e29eec2df5c Hedgeroid: Got the roomlist working... more or less.
Medo <smaxein@googlemail.com>
parents: 7332
diff changeset
     9
	public final long id; // for ListView
7330
867e4fda496e Hedgeroid: Layout experiments for the lobby page
Medo <smaxein@googlemail.com>
parents:
diff changeset
    10
	
7342
0e29eec2df5c Hedgeroid: Got the roomlist working... more or less.
Medo <smaxein@googlemail.com>
parents: 7332
diff changeset
    11
	public Player(String name, long id) {
7330
867e4fda496e Hedgeroid: Layout experiments for the lobby page
Medo <smaxein@googlemail.com>
parents:
diff changeset
    12
		this.name = name;
7342
0e29eec2df5c Hedgeroid: Got the roomlist working... more or less.
Medo <smaxein@googlemail.com>
parents: 7332
diff changeset
    13
		this.id = id;
7330
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
}