Bukkit  1.4.7-R1.0
 All Classes Namespaces Files Functions Variables Enumerator Pages
GameMode.java
Go to the documentation of this file.
1 package org.bukkit;
2 
3 import java.util.Map;
4 
5 import org.bukkit.entity.HumanEntity;
6 
7 import com.google.common.collect.Maps;
8 
12 public enum GameMode {
17 
22 
27 
28  private final int value;
29  private final static Map<Integer, GameMode> BY_ID = Maps.newHashMap();
30 
31  private GameMode(final int value) {
32  this.value = value;
33  }
34 
40  public int getValue() {
41  return value;
42  }
43 
50  public static GameMode getByValue(final int value) {
51  return BY_ID.get(value);
52  }
53 
54  static {
55  for (GameMode mode : values()) {
56  BY_ID.put(mode.getValue(), mode);
57  }
58  }
59 }