-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.py
56 lines (40 loc) · 1.07 KB
/
start.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
from server import server
from GameBoardShowCase import show_case_client
from client import client, client_ai
import threading
from time import sleep
class ServerThread(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
def run(self):
# run server
server.run()
class ShowCaseThread(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
def run(self):
# run show_case
show_case_client.run()
class ClientAiThread(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
def run(self):
# run ai player
client_ai.run()
class ClientThread(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
def run(self):
# run random player
client.run()
lock = threading.Lock()
serverT = ServerThread()
show_caseT = ShowCaseThread()
client_aiT = ClientAiThread()
clientT = ClientThread()
serverT.start()
sleep(1)
show_caseT.start()
sleep(1)
client_aiT.start()
clientT.start()