author | Medo <smaxein@googlemail.com> |
Sat, 18 Aug 2012 13:39:24 +0200 | |
changeset 7560 | e7ab89ab86f6 |
parent 7508 | 763d3961400b |
child 7584 | 7831c84cc644 |
permissions | -rw-r--r-- |
7485 | 1 |
/* |
2 |
* Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game |
|
3 |
* Copyright (c) 2011-2012 Richard Deurwaarder <xeli@xelification.com> |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or modify |
|
6 |
* it under the terms of the GNU General Public License as published by |
|
7 |
* the Free Software Foundation; version 2 of the License |
|
8 |
* |
|
9 |
* This program is distributed in the hope that it will be useful, |
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
13 |
* |
|
14 |
* You should have received a copy of the GNU General Public License |
|
15 |
* along with this program; if not, write to the Free Software |
|
16 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
|
17 |
*/ |
|
18 |
||
19 |
package org.hedgewars.hedgeroid.Datastructures; |
|
20 |
||
21 |
import java.util.ArrayList; |
|
22 |
import java.util.Collections; |
|
23 |
import java.util.List; |
|
24 |
||
25 |
||
26 |
/** |
|
27 |
* Game configuration from the point of view of the UI. This differs slightly from the |
|
28 |
* frontlib view, because the engine allows setting a separate initial health and weapon set |
|
29 |
* for each hog, while the Android UI currently only supports both attributes on a per-game |
|
30 |
* basis (initial health is contained in the scheme). |
|
31 |
* |
|
32 |
* This difference means that creating a GameConfig object from a frontlib object can, in |
|
33 |
* theory, lose information. This does not cause problems at the moment because for now |
|
34 |
* weaponset and initial health are always per-game, but that might change in the future. |
|
35 |
*/ |
|
36 |
public final class GameConfig { |
|
37 |
public static final String DEFAULT_STYLE = "Normal"; |
|
38 |
public static final String DEFAULT_SCHEME = "Default"; |
|
39 |
public static final String DEFAULT_WEAPONSET = "Default"; |
|
7508
763d3961400b
Hedgeroid: Frantic scrabbling toward the deadline
Medo <smaxein@googlemail.com>
parents:
7485
diff
changeset
|
40 |
public static final String DEFAULT_THEME = "Bamboo"; |
7485 | 41 |
|
42 |
public final String style; |
|
43 |
public final Scheme scheme; |
|
44 |
public final MapRecipe map; |
|
45 |
public final List<TeamInGame> teams; |
|
46 |
public final Weaponset weaponset; |
|
47 |
||
48 |
public GameConfig(String style, Scheme scheme, MapRecipe map, List<TeamInGame> teams, Weaponset weaponset) { |
|
49 |
this.style = style; |
|
50 |
this.scheme = scheme; |
|
51 |
this.map = map; |
|
52 |
this.teams = Collections.unmodifiableList(new ArrayList<TeamInGame>(teams)); |
|
53 |
this.weaponset = weaponset; |
|
54 |
} |
|
7508
763d3961400b
Hedgeroid: Frantic scrabbling toward the deadline
Medo <smaxein@googlemail.com>
parents:
7485
diff
changeset
|
55 |
|
763d3961400b
Hedgeroid: Frantic scrabbling toward the deadline
Medo <smaxein@googlemail.com>
parents:
7485
diff
changeset
|
56 |
@Override |
763d3961400b
Hedgeroid: Frantic scrabbling toward the deadline
Medo <smaxein@googlemail.com>
parents:
7485
diff
changeset
|
57 |
public String toString() { |
763d3961400b
Hedgeroid: Frantic scrabbling toward the deadline
Medo <smaxein@googlemail.com>
parents:
7485
diff
changeset
|
58 |
return "GameConfig [style=" + style + ", scheme=" + scheme + ", map=" |
763d3961400b
Hedgeroid: Frantic scrabbling toward the deadline
Medo <smaxein@googlemail.com>
parents:
7485
diff
changeset
|
59 |
+ map + ", teams=" + teams + ", weaponset=" + weaponset + "]"; |
763d3961400b
Hedgeroid: Frantic scrabbling toward the deadline
Medo <smaxein@googlemail.com>
parents:
7485
diff
changeset
|
60 |
} |
7485 | 61 |
} |