-
Notifications
You must be signed in to change notification settings - Fork 0
/
enums.py
46 lines (40 loc) · 828 Bytes
/
enums.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
#!/usr/bin/env python3
##
## PERSONAL PROJECT, 2021
## Chess
## File description:
## chess enums
##
from enum import Enum
class S(Enum): # State of the game
ONGOING = 0
STLMATE = 1
CKMATEW = 2
CKMATEB = 3
OUTTIMW = 4
OUTTIMB = 5
RESIGNW = 6
RESIGNB = 7
class lng(Enum):
FR = 0
EN = 1
class B(Enum): # Black's pieces
P = 0x10 # pawn
N = 0x11 # knight
B = 0x12 # bishop
R = 0x13 # rook
Q = 0x14 # queen
K = 0x15 # king
class W(Enum): # White's pieces
P = 0x20 # pawn
N = 0x21 # knight
B = 0x22 # bishop
R = 0x23 # rook
Q = 0x24 # queen
K = 0x25 # king
class P(Enum):
E = 0x00 # empty square
N = ord('N') # promotion knight
B = ord('B') # promotion bishop
R = ord('R') # promotion rook
Q = ord('Q') # promotion queen