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    * Survivor mode is about loosing the least amount of people.
10   * Genocide mode is about killing the greatest amount of people.
11   * In default mode you receive 2 points for 1 kill and -1 point for 1 lost. 
12   * 
13   * @author Radek 'Black_Hand' Pibil
14   *
15   */
16  public enum ScoreMode {
17  	
18  	DEFAULT(0),
19  	SURVIVOR(1),
20  	GENOCIDE(2);
21  	
22  	private static Map<Integer, ScoreMode> enums = new HashMap<Integer, ScoreMode>();
23  	
24  	public static ScoreMode getEnum(int id) {
25  		return enums.get(id);
26  	}
27  	
28  	static {
29  		for (ScoreMode item : ScoreMode.values()) {
30  			enums.put(item.id, item);
31  		}
32  	}
33  	
34  	public final int id;
35  	
36  	private ScoreMode(int id) {
37  		this.id = id;
38  	}
39  
40  }