-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMove.cpp
More file actions
executable file
·92 lines (74 loc) · 1.91 KB
/
Move.cpp
File metadata and controls
executable file
·92 lines (74 loc) · 1.91 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*
* Copyright 2023 University of Michigan EECS183
*
* Move.cpp
* Project UID 848fee0125dbb5eb53ed294f20dbef81
*
* <#Names#>
* <#Uniqnames#>
*
* Final Project - Elevators
*/
#include <cmath>
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
#include "Move.h"
using namespace std;
Move::Move(string commandString) : Move() {
//TODO: Implement non-default constructor
}
bool Move::isValidMove(Elevator elevators[NUM_ELEVATORS]) const {
//TODO: Implement isValidMove
//Returning false to prevent compilation error
return false;
}
void Move::setPeopleToPickup(const string& pickupList, const int currentFloor,
const Floor& pickupFloor) {
//TODO: Implement setPeopleToPickup
}
//////////////////////////////////////////////////////
////// DO NOT MODIFY ANY CODE BENEATH THIS LINE //////
//////////////////////////////////////////////////////
Move::Move() {
elevatorId = -1;
targetFloor = -1;
numPeopleToPickup = 0;
totalSatisfaction = 0;
isPass = false;
isPickup = false;
isSave = false;
isQuit = false;
}
bool Move::isPickupMove() const {
return isPickup;
}
bool Move::isPassMove() const {
return isPass;
}
bool Move::isSaveMove() const {
return isSave;
}
bool Move::isQuitMove() const {
return isQuit;
}
int Move::getElevatorId() const {
return elevatorId;
}
int Move::getTargetFloor() const {
return targetFloor;
}
int Move::getNumPeopleToPickup() const {
return numPeopleToPickup;
}
int Move::getTotalSatisfaction() const {
return totalSatisfaction;
}
void Move::setTargetFloor(int inTargetFloor) {
targetFloor = inTargetFloor;
}
void Move::copyListOfPeopleToPickup(int newList[MAX_PEOPLE_PER_FLOOR]) const {
for (int i = 0; i < numPeopleToPickup; ++i) {
newList[i] = peopleToPickup[i];
}
}