project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/netplay/Room.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 
       
     3 import java.util.Comparator;
     2 
     4 
     3 import org.hedgewars.hedgeroid.R;
     5 import org.hedgewars.hedgeroid.R;
     4 
     6 
     5 import android.content.res.Resources;
     7 import android.content.res.Resources;
     6 
     8 
     7 public class Room {
     9 public class Room {
     8 	public static final String MAP_REGULAR = "+rnd+";
    10 	public static final String MAP_REGULAR = "+rnd+";
     9 	public static final String MAP_MAZE = "+maze+";
    11 	public static final String MAP_MAZE = "+maze+";
    10 	public static final String MAP_DRAWN = "+drawn+";
    12 	public static final String MAP_DRAWN = "+drawn+";
       
    13 	public static final Comparator<Room> ID_COMPARATOR = new ByIdComparator();
    11 	
    14 	
    12 	public final String name, map, scheme, weapons, owner;
    15 	public final String name, map, scheme, weapons, owner;
    13 	public final int playerCount, teamCount;
    16 	public final int playerCount, teamCount;
    14 	public final boolean inProgress;
    17 	public final boolean inProgress;
    15 	public final long id;	// for ListView
    18 	public final long id;	// for ListView
    37 				return res.getString(R.string.map_drawn);
    40 				return res.getString(R.string.map_drawn);
    38 			}
    41 			}
    39 		}
    42 		}
    40 		return map;
    43 		return map;
    41 	}
    44 	}
       
    45 	
       
    46 	private static final class ByIdComparator implements Comparator<Room> {
       
    47 		public int compare(Room lhs, Room rhs) {
       
    48 			return lhs.id<rhs.id ? -1 : lhs.id>rhs.id ? 1 : 0;
       
    49 		}
       
    50 	}
    42 }
    51 }