1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package ch.twiddlefinger.inet.rewinder.model.entities;
19
20 /***
21 * @author matthias.vonrohr
22 *
23 * To change the template for this generated type comment go to
24 * Window>Preferences>Java>Code Generation>Code and Comments
25 */
26 public class GameType {
27
28 private int type;
29
30 /*** FFA or Singleplayer ladder game */
31 public static final GameType LADDER_FFA = new GameType(0x01);
32 /*** Custom game */
33 public static final GameType CUSTOM = new GameType(0x09);
34 /*** Singleplayer game */
35 public static final GameType SINGLEPLAYER = new GameType(0x1D);
36 /*** Team Ladder game (2on2/3on3/4on4 AT/RT) */
37 public static final GameType LADDER_TEAM = new GameType(0x20);
38 /*** unsupported game type */
39 public static final GameType UNKNOWN = new GameType(0xFF);
40
41 public GameType(int type) {
42 this.type = type;
43 }
44
45 public String toString() {
46 switch (type) {
47 case 0x01 :
48 return "Ladder 1on1 or FFA";
49
50 case 0x09 :
51 return "Custom game";
52
53 case 0x1D :
54 return "Singleplayer Game";
55
56 case 0x20 :
57 return "Ladder Team game (AT/RT 2on2/3on3/4on4)";
58
59 default :
60 return "unknown gametype";
61 }
62 }
63
64 public boolean equals(Object o) {
65 if(o instanceof GameType) {
66 return ((GameType)o).type == this.type;
67 } else {
68 return false;
69 }
70 }
71
72 }