forked from SharifAIChallenge/AIC16-Client-Cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathController.h
More file actions
45 lines (39 loc) · 754 Bytes
/
Controller.h
File metadata and controls
45 lines (39 loc) · 754 Bytes
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
/*
* Controller.h
*
* Created on: Feb 3, 2015
* Author: rmin
*/
#ifndef CONTROLLER_H_
#define CONTROLLER_H_
#include <ctime>
#include "Message.h"
#include "AI.h"
#include "Game.h"
#include <fstream>
#include <string>
#include "EventHandler.h"
const long int MAX_TIME_FOR_DO_TURN = 400;
class Network;
class Controller {
private:
std::string token,ip;
int port;
int retryDelay;
AI* client;
Game* game;
Network* network;
time_t time;
void handleTurnMessage(Message &msg);
void handleInitMessage(Message &msg);
Message getEvents();
void doTurn();
void run();
public:
void handleMessage(Message &msg);
Controller(std::string* args);
void start();
bool getIsThreadCall();
virtual ~Controller();
};
#endif /* CONTROLLER_H_ */