forked from benjyberk/ADP-ex4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
62 lines (56 loc) · 1.57 KB
/
main.cpp
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
//
// Benjy Berkowicz - 336182589
// Advanced Programming 2016-2017 Bar Ilan
//
#include <cstdlib>
#include <string.h>
#include "Point.h"
#include "GridMap.h"
#include "GameControl.h"
using namespace std;
int main() {
string lineInput;
int getChoice;
char dummy;
GameControl * gc = new GameControl();
gc->getGeneralInput();
getline(cin, lineInput);
getChoice = atoi(lineInput.c_str());
while (getChoice != 7) {
if (getChoice < 6) {
getline(cin, lineInput);
}
switch (getChoice) {
case 1:
cout << "Entering case " << getChoice << endl;
gc->addDriver(lineInput);
break;
case 2:
cout << "Entering case " << getChoice << endl;
gc->addRide(lineInput);
break;
case 3:
cout << "Entering case " << getChoice << endl;
gc->addTaxi(lineInput);
break;
case 4:
cout << "Entering case " << getChoice << endl;
gc->printTaxiLocation(lineInput);
break;
case 6:
cout << "Entering case " << getChoice << endl;
gc->assignTaxiTrips();
break;
case 9:
cout << "Entering case " << getChoice << endl;
gc->moveOneStep();
break;
default:
break;
}
getline(cin, lineInput);
getChoice = atoi(lineInput.c_str());
}
delete gc;
return 0;
}