project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/RoomlistRoom.java
equal
deleted
inserted
replaced
1 package org.hedgewars.hedgeroid.Datastructures; |
1 package org.hedgewars.hedgeroid.Datastructures; |
2 |
|
3 import org.hedgewars.hedgeroid.R; |
|
4 |
2 |
5 import android.content.res.Resources; |
3 import android.content.res.Resources; |
6 |
4 |
7 public final class RoomlistRoom { |
5 public final class RoomlistRoom { |
8 public static final String MAP_REGULAR = "+rnd+"; |
|
9 public static final String MAP_MAZE = "+maze+"; |
|
10 public static final String MAP_DRAWN = "+drawn+"; |
|
11 |
|
12 public final String name, map, scheme, weapons, owner; |
6 public final String name, map, scheme, weapons, owner; |
13 public final int playerCount, teamCount; |
7 public final int playerCount, teamCount; |
14 public final boolean inProgress; |
8 public final boolean inProgress; |
15 |
9 |
16 public RoomlistRoom(String name, String map, String scheme, String weapons, |
10 public RoomlistRoom(String name, String map, String scheme, String weapons, |
23 this.playerCount = playerCount; |
17 this.playerCount = playerCount; |
24 this.teamCount = teamCount; |
18 this.teamCount = teamCount; |
25 this.inProgress = inProgress; |
19 this.inProgress = inProgress; |
26 } |
20 } |
27 |
21 |
28 public static String formatMapName(Resources res, String map) { |
|
29 if(map.charAt(0)=='+') { |
|
30 if(map.equals(MAP_REGULAR)) { |
|
31 return res.getString(R.string.map_regular); |
|
32 } else if(map.equals(MAP_MAZE)) { |
|
33 return res.getString(R.string.map_maze); |
|
34 } else if(map.equals(MAP_DRAWN)) { |
|
35 return res.getString(R.string.map_drawn); |
|
36 } |
|
37 } |
|
38 return map; |
|
39 } |
|
40 |
|
41 public String formatMapName(Resources res) { |
22 public String formatMapName(Resources res) { |
42 return formatMapName(res, map); |
23 return MapRecipe.formatMapName(res, map); |
43 } |
24 } |
44 |
25 |
45 @Override |
26 @Override |
46 public String toString() { |
27 public String toString() { |
47 return "RoomlistRoom [name=" + name + ", map=" + map + ", scheme=" |
28 return "RoomlistRoom [name=" + name + ", map=" + map + ", scheme=" |