1 package org.hedgewars.hedgeroid.netplay; |
1 package org.hedgewars.hedgeroid.netplay; |
2 |
|
3 import java.util.Comparator; |
|
4 |
2 |
5 import org.hedgewars.hedgeroid.R; |
3 import org.hedgewars.hedgeroid.R; |
6 |
4 |
7 import android.content.res.Resources; |
5 import android.content.res.Resources; |
8 |
6 |
9 public class Room { |
7 public class Room { |
10 public static final String MAP_REGULAR = "+rnd+"; |
8 public static final String MAP_REGULAR = "+rnd+"; |
11 public static final String MAP_MAZE = "+maze+"; |
9 public static final String MAP_MAZE = "+maze+"; |
12 public static final String MAP_DRAWN = "+drawn+"; |
10 public static final String MAP_DRAWN = "+drawn+"; |
13 public static final Comparator<Room> ID_COMPARATOR = new ByIdComparator(); |
|
14 |
11 |
15 public final String name, map, scheme, weapons, owner; |
12 public final String name, map, scheme, weapons, owner; |
16 public final int playerCount, teamCount; |
13 public final int playerCount, teamCount; |
17 public final boolean inProgress; |
14 public final boolean inProgress; |
18 public final long id; // for ListView |
|
19 |
15 |
20 public Room(String name, String map, String scheme, String weapons, |
16 public Room(String name, String map, String scheme, String weapons, |
21 String owner, int playerCount, int teamCount, boolean inProgress, long id) { |
17 String owner, int playerCount, int teamCount, boolean inProgress) { |
22 this.name = name; |
18 this.name = name; |
23 this.map = map; |
19 this.map = map; |
24 this.scheme = scheme; |
20 this.scheme = scheme; |
25 this.weapons = weapons; |
21 this.weapons = weapons; |
26 this.owner = owner; |
22 this.owner = owner; |
27 this.playerCount = playerCount; |
23 this.playerCount = playerCount; |
28 this.teamCount = teamCount; |
24 this.teamCount = teamCount; |
29 this.inProgress = inProgress; |
25 this.inProgress = inProgress; |
30 this.id = id; |
|
31 } |
26 } |
32 |
27 |
33 public static String formatMapName(Resources res, String map) { |
28 public static String formatMapName(Resources res, String map) { |
34 if(map.charAt(0)=='+') { |
29 if(map.charAt(0)=='+') { |
35 if(map.equals(MAP_REGULAR)) { |
30 if(map.equals(MAP_REGULAR)) { |