1 package cz.cuni.amis.pogamut.defcon.consts.state;
2
3 import java.util.HashMap;
4 import java.util.Map;
5
6 import javabot.JBot;
7
8
9
10
11
12
13
14 public enum SubState implements IState {
15
16 PASSIVE_SONAR(JBot.STATE_SUBPASSIVESONAR),
17 ACTIVE_SONAR(JBot.STATE_SUBACTIVESONAR),
18 NUKE(JBot.STATE_SUBNUKE);
19
20 private static Map<Integer, SubState> states = new HashMap<Integer, SubState>();
21
22 public static SubState getState(int stateId) {
23 return states.get(stateId);
24 }
25
26 static {
27 for (SubState state : SubState.values()) {
28 states.put(state.getStateId(), state);
29 }
30 }
31
32 public final int id;
33
34 private SubState(int id) {
35 this.id = id;
36 }
37
38 @Override
39 public int getStateId() {
40 return id;
41 }
42
43 @Override
44 public Enum<? extends IState> getEnum() {
45 return this;
46 }
47
48 }