-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathConstants.py
50 lines (39 loc) · 979 Bytes
/
Constants.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
from enum import IntEnum, Enum
NUM_TANKS = 5 # number of each player tanks
class Result(IntEnum):
"""
Enumerator of all possible result codes given in the docs.
"""
OKAY = 0
BAD_COMMAND = 1
ACCESS_DENIED = 2
INAPPROPRIATE_GAME_STATE = 3
TIMEOUT = 4
INTERNAL_SERVER_ERROR = 500
def __eq__(self, other):
if isinstance(other, Result):
return self.value == other.value
return self.value == other # if it's int
class Action(IntEnum):
LOGIN = 1
LOGOUT = 2
MAP = 3
GAME_STATE = 4
GAME_ACTIONS = 5
TURN = 6
CHAT = 100
MOVE = 101
SHOOT = 102
class HexTypes(Enum):
EMPTY = "Empty"
BASE = "Base"
OBSTACLE = "Obstacle"
LIGHT_REPAIR = "LightRepair"
HARD_REPAIR = "HardRepair"
CATAPULT = "Catapult"
class TankTypes(Enum):
AT_SPG = "AT_SPG"
HEAVY_TANK = "HEAVY_TANK"
LIGHT_TANK = "LIGHT_TANK"
MEDIUM_TANK = "MEDIUM_TANK"
SPG = "SPG"