-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGameControl.h
48 lines (42 loc) · 1.38 KB
/
GameControl.h
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
//
// Benjy Berkowicz - 336182589
// Advanced Programming 2016-2017 Bar Ilan
//
#ifndef ADVANCED_EX2_GAMECONTROL_H
#define ADVANCED_EX2_GAMECONTROL_H
#include <map>
#include "TaxiDispatch.h"
#include "Clock.h"
/**
* The Game Control class handles all input and directs the creation
* of the objects needed for the game.
*/
class GameControl {
private:
std::vector<Point> obstacles;
GridMap * gridmap;
TaxiDispatch * dispatcher;
Clock clock;
public:
// Converts the input string into the enumeration based on type
int enumFromString(std::string raw, char type);
// Tokenizes a string and returns the vector
std::vector<std::string> tokenizeByChar(std::string, char);
GameControl();
// Parses a driver from input and adds it to the Taxi Dispatcher
void addDriver(std::string, char* args[]);
// Parses a taxi from input and adds it to the Taxi Dispatcher
void addTaxi(std::string input);
// Parses the dimensions of the game, creates the gridmap and obstacles elements
void getGeneralInput();
// Adds a new trip to the taxi dispatcher
void addRide(std::string);
// Outputs the location of a taxi
void printTaxiLocation(std::string);
// Moves all taxis assigned on trips
void moveOneStep();
// Close all sockets, release data
void closingOperations();
~GameControl();
};
#endif //ADVANCED_EX2_GAMECONTROL_H