View Javadoc

1   package cz.cuni.amis.pogamut.defcon.consts;
2   
3   import java.util.HashMap;
4   import java.util.Map;
5   
6   /**
7    * One of the game options. Might be accessed through {@link GameInfo#GetOptionValue()}
8    * and {@link GameOption}.
9    * 
10   * @author Radek 'Black_Hand' Pibil
11   *
12   */
13  public enum GameMode {
14  	
15  	DEFAULT(0),
16  	OFFICE_MODE(1),
17  	SPEED_DEFCON(2),
18  	DIPLOMACY(3),
19  	BIG_WORLD(4),
20  	TOURNAMENT(5),
21  	CUSTOM(6);
22  	
23  	private static Map<Integer, GameMode> enums = new HashMap<Integer, GameMode>();
24  	
25  	public static GameMode getEnum(int id) {
26  		return enums.get(id);
27  	}
28  	
29  	static {
30  		for (GameMode item : GameMode.values()) {
31  			enums.put(item.id, item);
32  		}
33  	}
34  	
35  	public final int id;
36  	
37  	private GameMode(int id) {
38  		this.id = id;
39  	}
40  
41  }