View Javadoc

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   	 * Name of the game server.
10  	 */
11  	SERVER_NAME("ServerName", 0, 24, 0),
12  	/**
13  	 * Game will be advertised on the Metaserver if enabled. (Disabled, Enabled).
14  	 */
15  	ADVERTISE_ON_INTERNET("AdvertiseOnInternet", 0, 1, 1),
16  	/**
17  	 * Game will be advertised in the local network if enabled. (Disabled, Enabled)
18  	 */
19  	ADVERTISE_ON_LAN("AdvertiseOnLAN", 0, 1, 1),
20  	/**
21  	 * Default, Office Mode, Speed Defcon, Diplomacy, BigWorld, Tournament, Custom
22  	 */
23  	GAME_MODE("GameMode", 0, 6, 0),
24  	/**
25  	 * Maximum number of participating players.
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  	 * Maximum number of participating players.
32  	 */
33  	POPULATION_PER_TERRITORY("PopulationPerTerritory", 10, 200, 100),
34  	/**
35  	 * Distribution of population in cities (Default, Equalised, Random, TotallyRandom)
36  	 */
37  	CITY_POPULATIONS("CityPopulations", 0, 3, 0),
38  	/**
39  	 * Disable selection of territories (No, Yes)
40  	 */
41  	RANDOM_TERRITORIES("RandomTerritories", 0, 1, 0),
42  	/**
43  	 * No, Yes
44  	 */
45  	PERMIT_DEFECTION("PermitDefection", 0, 1, 1),
46  	/**
47  	 * AlwaysOff, Alliance, Selective, AlwaysOn
48  	 */
49  	RADAR_SHARING("RadarSharing", 0, 3, 1),
50  	/**
51  	 * Slowest Requested, Real Time, 5x Real Time, 10x Real Time, 20x Real Time
52  	 */
53  	GAME_SPEED("GameSpeed", 0, 4, 0),
54  	/**
55  	 * Pause, Real Time, 5x Real Time, 10x Real Time, 20x Real Time
56  	 */
57  	SLOWEST_SPEED("SlowestSpeed", 0, 4, 1),
58  	/**
59  	 * Default, Survivor, Genocide
60  	 */
61  	SCORE_MODE("ScoreMode", 0, 2, 0),
62  	/**
63  	 * Percent of remaining nukes before victory timer starts.
64  	 */
65  	VICTORY_TRIGGER("VictoryTrigger", 0, 100, 20),
66  	/**
67  	 * Duration of victory timer in minutes.
68  	 */
69  	VICTORY_TIMER("VictoryTimer", 0, 600, 45),
70  	/**
71  	 * Variable units allows the placement of units by credit (Disabled, Enabled).
72  	 */
73  	VARIABLE_UNIT_COUNT("VariableUnitCount", 0, 1, 0),
74  	/**
75  	 * Scale of the worldmap, in percent.
76  	 */
77  	WORLD_SCALE("WorldScale", 50, 200, 100),
78  	MAX_SPECTATORS("MaxSpectators", 0, 100, 3),
79  	/**
80  	 * Private, Public
81  	 */
82  	SPECTATOR_CHAT_CHANNEL("SpectatorChatChannel", 0, 1, 1),
83  	/**
84  	 * If enabled, teams can be switched during the game (Disabled, Enabled)
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 }