View Javadoc

1   package nl.tudelft.goal.ut2004.visualizer.options;
2   
3   /**
4    * List of preferrences flags related to links between waypoints in unreal map.
5    */
6   public enum MapFlag {
7       WALK("mapFlagWalk", 1, true),
8       FLY("mapFlagFlyFly", 2, false),
9       SWIM("mapFlagSwim", 4, false),
10      JUMP("mapFlagJump", 8, false),
11      DOOR("mapFlagDoor", 16, true),
12      SPECIAL("mapFlagSpecial", 32, true),
13      LADDER("mapFlagLadder", 64, true),
14      PROSCRIBED("mapFlagProscribed", 128, true),
15      FORCED("mapFlagForced", 256, true),
16      PLAYER_ONLY("mapFlagPlayerOnly", 512, true);
17  
18      private final String prefKey;
19      private final int flag;
20      private final boolean defaultValue;
21  
22      private MapFlag(String prefKey, int flag, boolean defaultValue) {
23          this.prefKey = prefKey;
24          this.flag = flag;
25          this.defaultValue = defaultValue;
26      }
27  
28      /**
29       * Get preferences key for TimelinePanel.
30       * <p>
31       * Get the value of preference through NbPreferences.forModule(TimelinePanel.class).getBoolean(String prefKey, boolean ifNothingSet)
32       * @return
33       */
34      public String getPrefKey() {
35          return prefKey;
36      }
37  
38      /**
39       * Get default value of this flag
40       * @return wheather to show or not show edges wioth this flag
41       */
42      public boolean getDefault() {
43          return defaultValue;
44      }
45  
46      /**
47       * Return int value that is used by unreal engine to represent this flag
48       * in waylinks.
49       * @return 1 bit integer (2^n, like 1,2,4,8,..)
50       */
51      public int getFlag() {
52          return flag;
53      }
54  
55      @Override
56      public String toString() {
57          return prefKey;
58      }
59  }