project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/netplay/Room.java
author Medo <smaxein@googlemail.com>
Thu, 26 Jul 2012 11:01:32 +0200
changeset 7358 57a508884052
parent 7352 641f11cdd319
permissions -rw-r--r--
Hedgeroid: Major overhaul of the network connection code. Now it is threaded and errors are handled properly.

package org.hedgewars.hedgeroid.netplay;

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 playerCount, teamCount;
	public final boolean inProgress;
	
	public Room(String name, String map, String scheme, String weapons,
			String owner, int playerCount, int teamCount, boolean inProgress) {
		this.name = name;
		this.map = map;
		this.scheme = scheme;
		this.weapons = weapons;
		this.owner = owner;
		this.playerCount = playerCount;
		this.teamCount = teamCount;
		this.inProgress = inProgress;
	}

	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;
	}
}