project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/netplay/Room.java
changeset 7342 0e29eec2df5c
parent 7332 3f2e130f9715
child 7352 641f11cdd319
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/netplay/Room.java	Thu Jul 19 18:31:58 2012 +0200
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/netplay/Room.java	Thu Jul 19 18:58:18 2012 +0200
@@ -1,9 +1,42 @@
 package org.hedgewars.hedgeroid.netplay;
 
-import org.hedgewars.hedgeroid.netplay.JnaFrontlib.RoomPtr;
-/*
+import org.hedgewars.hedgeroid.R;
+
+import android.content.res.Resources;
+
 public class Room {
+	public static final String MAP_REGULAR = "+rnd+";
+	public static final String MAP_MAZE = "+maze+";
+	public static final String MAP_DRAWN = "+drawn+";
+	
 	public final String name, map, scheme, weapons, owner;
-	public final int players, clans;
+	public final int playerCount, teamCount;
 	public final boolean inProgress;
-}*/
+	public final long id;	// for ListView
+	
+	public Room(String name, String map, String scheme, String weapons,
+			String owner, int playerCount, int teamCount, boolean inProgress, long id) {
+		this.name = name;
+		this.map = map;
+		this.scheme = scheme;
+		this.weapons = weapons;
+		this.owner = owner;
+		this.playerCount = playerCount;
+		this.teamCount = teamCount;
+		this.inProgress = inProgress;
+		this.id = id;
+	}
+
+	public static String formatMapName(Resources res, String map) {
+		if(map.charAt(0)=='+') {
+			if(map.equals(MAP_REGULAR)) {
+				return res.getString(R.string.map_regular);
+			} else if(map.equals(MAP_MAZE)) {
+				return res.getString(R.string.map_maze);
+			} else if(map.equals(MAP_DRAWN)) {
+				return res.getString(R.string.map_drawn);
+			}
+		}
+		return map;
+	}
+}