-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathElevator.cpp
More file actions
executable file
·59 lines (48 loc) · 1.14 KB
/
Elevator.cpp
File metadata and controls
executable file
·59 lines (48 loc) · 1.14 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
/*
* Copyright 2023 University of Michigan EECS183
*
* Elevator.cpp
* Project UID 848fee0125dbb5eb53ed294f20dbef81
*
* <#Names#>
* <#Uniqnames#>
*
* Final Project - Elevators
*/
#include "Elevator.h"
#include <iostream>
using namespace std;
void Elevator::tick(int currentTime) {
//TODO: Implement tick
}
void Elevator::serviceRequest(int floorNum) {
//TODO: Implement serviceRequest
}
//////////////////////////////////////////////////////
////// DO NOT MODIFY ANY CODE BENEATH THIS LINE //////
//////////////////////////////////////////////////////
void Elevator::print(ostream &outs) {
outs << currentFloor;
if (!servicing){
outs << "w";
} else {
outs << "s" << targetFloor;
}
}
Elevator::Elevator() {
currentFloor = 0;
servicing = false;
targetFloor = 0;
}
void Elevator::setCurrentFloor(int currentFloorIn) {
currentFloor = currentFloorIn;
}
bool Elevator::isServicing() const {
return servicing;
}
int Elevator::getCurrentFloor() const {
return currentFloor;
}
int Elevator::getTargetFloor() const {
return targetFloor;
}