1 package cz.cuni.amis.pogamut.defcon.consts;
2
3 import java.util.HashMap;
4 import java.util.Map;
5
6 public enum GameOption {
7
8
9
10
11 SERVER_NAME("ServerName", 0, 24, 0),
12
13
14
15 ADVERTISE_ON_INTERNET("AdvertiseOnInternet", 0, 1, 1),
16
17
18
19 ADVERTISE_ON_LAN("AdvertiseOnLAN", 0, 1, 1),
20
21
22
23 GAME_MODE("GameMode", 0, 6, 0),
24
25
26
27 MAX_TEAMS("MaxTeams", 1, 6, 3),
28 TERRITORIES_PER_TEAM("TerritoriesPerTeam", 1, 6, 1),
29 CITIES_PER_TERRITORY("CitiesPerTerritory", 1, 50, 25),
30
31
32
33 POPULATION_PER_TERRITORY("PopulationPerTerritory", 10, 200, 100),
34
35
36
37 CITY_POPULATIONS("CityPopulations", 0, 3, 0),
38
39
40
41 RANDOM_TERRITORIES("RandomTerritories", 0, 1, 0),
42
43
44
45 PERMIT_DEFECTION("PermitDefection", 0, 1, 1),
46
47
48
49 RADAR_SHARING("RadarSharing", 0, 3, 1),
50
51
52
53 GAME_SPEED("GameSpeed", 0, 4, 0),
54
55
56
57 SLOWEST_SPEED("SlowestSpeed", 0, 4, 1),
58
59
60
61 SCORE_MODE("ScoreMode", 0, 2, 0),
62
63
64
65 VICTORY_TRIGGER("VictoryTrigger", 0, 100, 20),
66
67
68
69 VICTORY_TIMER("VictoryTimer", 0, 600, 45),
70
71
72
73 VARIABLE_UNIT_COUNT("VariableUnitCount", 0, 1, 0),
74
75
76
77 WORLD_SCALE("WorldScale", 50, 200, 100),
78 MAX_SPECTATORS("MaxSpectators", 0, 100, 3),
79
80
81
82 SPECTATOR_CHAT_CHANNEL("SpectatorChatChannel", 0, 1, 1),
83
84
85
86 TEAM_SWITCHING("TeamSwitching", 0, 1, 0),
87 SERVER_PASSWORD("ServerPasswords", 0, 16, 0);
88
89 private static Map<String, GameOption> enums = new HashMap<String, GameOption>();
90
91 public static GameOption getEnum(String option) {
92 return enums.get(option);
93 }
94
95 static {
96 for (GameOption item : GameOption.values()) {
97 enums.put(item.name, item);
98 }
99 }
100
101 public final String name;
102 public final int min;
103 public final int max;
104 public final int def;
105
106 private GameOption(String name, int min, int max, int def) {
107 this.name = name;
108 this.min = min;
109 this.max = max;
110 this.def = def;
111 }
112
113 public String getName() {
114 return name;
115 }
116
117 }