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