-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshared.py
109 lines (101 loc) · 2.45 KB
/
shared.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
import numpy as np
from basic_data import *
from copy import deepcopy
from itertools import cycle
from logic import STATES_P1, STATES_P2, STATES_P1_COUNTER, STATES_P2_COUNTER
from theme import *
from PIL import Image
BLACK = """QLabel#Disabled {
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 0.75, x3: 0, y3: 1, stop: 0 #000000, stop: 0.75 #808080, stop: 1 #000000);
color: #ffffff;
border: 3px outset #202020;
border-radius: 6px;
}"""
X = bytearray(np.array(Image.open(f"{FOLDER}/icons/X.png")))
O = bytearray(np.array(Image.open(f"{FOLDER}/icons/O.png")))
RUN = cycle(["Stop", "Start"])
PAUSE = cycle(["Resume", "Pause"])
STATES = (STATES_P1, STATES_P2)
COUNTER_STATES = (STATES_P1_COUNTER, STATES_P2_COUNTER)
SEXDECIM = ["High"] + ["Mock"] * 15
SEXTET = ("Cell", "Hover", "P1", "P2", "P1Win", "P2Win")
NONSENSE = [
"Lorem",
"ipsum",
"dolor",
"sit",
"amet",
"consectetur",
"adipiscing",
"elit",
"sed",
"do",
"eiusmod",
"tempor",
"incididunt",
"ut",
"labore",
"et",
]
PLAYERINFO = {
"PX": ["PO", "cross", STATES_P1, STATES_P2],
"PO": ["PX", "nought", STATES_P1_COUNTER, STATES_P2_COUNTER],
}
CONTROL = (
("Default", "restore_default"),
("OK", "apply_style"),
("Cancel", "revert_style"),
)
QUADDRUPLE = (
"game",
"turn",
"active",
"winner",
)
STYLIZER = Style_Combiner(CONFIG)
NONSENSE_COPY = NONSENSE.copy()
TRINITY = ["Base", "Hover", "Pressed"]
BUTTONS = TRINITY * 5
BUTTONS_COPY = BUTTONS.copy()
CHECKBOX_STATES = [(t, i) for i in (0, 1) for t in TRINITY]
CHECKBOXES = CHECKBOX_STATES * 3
CHECKBOXES_COPY = CHECKBOXES.copy()
RADIOBUTTONS = CHECKBOX_STATES * 2
RADIOBUTTONS_COPY = RADIOBUTTONS.copy()
CONFIG_COPY = deepcopy(CONFIG)
PLAYER_NAMES = (
"Human",
"Novice AI",
"Adept AI",
"Master AI",
"Master AI+",
"Super AI",
"Super AI+",
)
PLAYERS = {
"players": PLAYER_NAMES,
"opponents": {
k: PLAYER_NAMES[:i] + PLAYER_NAMES[i + 1 :] for i, k in enumerate(PLAYER_NAMES)
},
}
BORDER_STYLES = (
"dotted",
"dashed",
"solid",
"double",
"groove",
"ridge",
"inset",
"outset",
"none",
"hidden",
)
CELLNAMES = ("Cell", "Hover", "P1", "P2", "P1Win", "P2Win")
CELLKEYS = (
"board_base",
"board_hover",
"player1_base",
"player2_base",
"player1_win",
"player2_win",
)