-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWindow.cpp
More file actions
69 lines (57 loc) · 1.45 KB
/
Copy pathWindow.cpp
File metadata and controls
69 lines (57 loc) · 1.45 KB
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
/*
Derek Norman
2364922
norman@chapman.edu
CPSC-350-03
Assignment 5
*/
/*
* Window class, a simple representation of a window where a student can meet with advisor/teacher
*/
#include "Window.h"
Window::Window(){ //constructor
idleTime = 0;
isOccupied = false;
student = nullptr;
}
Window::Window(Student *s){ //overloaded constructor
idleTime = 0;
isOccupied = true;
student = s;
}
Window::~Window(){ //destructor
delete student;
}
/*
* Method getIdleTime, returns the idle time of the window
* Returns an int representing the idle time of the window
*/
int Window::getIdleTime(){ //returns the time the window has been idle
return idleTime;
}
/*
* Method updateIdleTime, increments the idle time of the window
*/
void Window::updateIdleTime(){
idleTime++; //increments amount of time window has been idle
}
/*
* Method isWindowIdle, returns if the window is idle or not
* returns a bool representing if window is idle or not
*/
bool Window::isWindowIdle(){ //returns if the window is busy or not. if the window is not busy then returns true that window is idle, if window is busy then returns false that window is idle
return (isOccupied == false);
}
/*
* Method setWindowBusy, sets the window to busy meaning it is occupied
*/
void Window::setWindowBusy(){
isOccupied = true;
}
/*
* Method getStudent, returns the student at the window
* Returns the student at the window
*/
Student* Window::getStudent(){
return student;
}