-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathClasses.py
83 lines (61 loc) · 1.88 KB
/
Classes.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
class Group:
groups = None
def __init__(self, name, size):
self.name = name
self.size = size
@staticmethod
def find(name):
for i in range(len(Group.groups)):
if Group.groups[i].name == name:
return i
return -1
def __repr__(self):
return "Group: " + self.name + ", Size: " + str(self.size)
class Professor:
professors = None
def __init__(self, name):
self.name = name
@staticmethod
def find(name):
for i in range(len(Professor.professors)):
if Professor.professors[i].name == name:
return i
return -1
def __repr__(self):
return "Professor: " + self.name
class CourseClass:
classes = None
def __init__(self, code, is_lab=False):
self.code = code
self.is_lab = is_lab
@staticmethod
def find(code):
for i in range(len(CourseClass.classes)):
if CourseClass.classes[i].code == code:
return i
return -1
def __repr__(self):
return "CourseClass: " + self.code
class Room:
rooms = None
def __init__(self, name, size, is_lab=False):
self.name = name
self.size = size
self.is_lab = is_lab
@staticmethod
def find(name):
for i in range(len(Room.rooms)):
if Room.rooms[i].name == name:
return i
return -1
def __repr__(self):
return "Room: " + self.name + " Size: " + str(self.size)
class Slot:
slots = None
def __init__(self, start, end, day, is_lab_slot=False):
self.start = start
self.end = end
self.day = day
self.is_lab_slot = is_lab_slot
def __repr__(self):
return "Slot: " + self.start + "-" + self.end + " Day: " + self.day