-
Notifications
You must be signed in to change notification settings - Fork 0
/
objs.py
70 lines (57 loc) · 1.93 KB
/
objs.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
teams = []
players = []
levels = []
class Game:
def __init__(self, name):
self.name = name
self.levels = []
class LevelsFile:
def __init__(self, password):
self.password = password
self.files = []
class Level:
def __init__(self, level, teamcode, starttime):
self.level = level
self.teamcode = teamcode
self.starttime = starttime
self.endtime = None
self.helpstime = []
def __str__(self):
return 'مرحله {}= زمان شروع: {}. زمان پایان: {}. راهنمایی ها: {}'.format(
self.level, self.starttime, self.endtime, self.helpstime)
class Team:
def __init__(self, name: str, code: int):
self.name = name
self.code = code
self.members = []
self.levels = []
self.memberscount = len(self.members)
self.statuspay = False
self.score = 0
def __str__(self):
s = '\n'.join(map(str, self.members))
le = None
for p in self.members:
if p.leader:
le = p
break
return '🎛نام تیم: {}\n🀄️کد تیم: {}\n👤سرگروه:\n {}\n👥اعضا:\n{}\n'.format(self.name, self.code, le, s)
class Player:
def __init__(self, tc, ci, si, sf, phn, un, n):
self.teamcode = tc
self.chatid = ci
self.studentid = si
self.studyfield = sf
self.phonenumber = phn
self.username = un
self.name = n
self.currans = ''
self.tmpmessage = None
self.leader = False
self.activate = False
self.presence = False
self.c = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
def __str__(self):
return '➖نام: {}، آیدی: {}، شماره دانشجویی: {}، رشته تحصیلی: {}، شماره: {}'.format(
self.name, self.username, self.studentid, self.studyfield, self.phonenumber
)