-
Notifications
You must be signed in to change notification settings - Fork 0
/
Machine.py
46 lines (36 loc) · 1.08 KB
/
Machine.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
class Machine:
def __init__(self, machType):
self.machType = machType
self.user = 0
self.time = 0
self.hasNotified = False
#machine is in Use
def use(self, user, time, hasNotified):
self.user = user
self.time = time
self.hasNotified = hasNotified
return True
def isInUse(self):
return self.user != 0
def getType(self):
return self.machType
def getUser(self):
return self.user
def getTime(self):
return self.time
def getNotified(self):
return self.hasNotified
def done(self):
self.user = 0
self.time = 0
self.hasNotified = False
return True
def alrNotified(self):
self.hasNotified = True
return True
def makeForStorage(self):
# chat_ID = machineStatus[i][0]
# startTime = machineStatus[i][1]
# hasNotified = machineStatus[i][2]
help = str(self.user) + "|" + str(self.time) + "|" + str(self.hasNotified) + "|" + str(self.machType) + "|"
return help