-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgame.h
More file actions
56 lines (45 loc) · 997 Bytes
/
game.h
File metadata and controls
56 lines (45 loc) · 997 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
46
47
48
49
50
51
52
53
54
55
56
#ifndef _GAME_H_
#define _GAME_H_
#include <SFML/Graphics.hpp>
#include "imageManager.h"
#include "client.h"
#include "server.h"
class Game
{
public:
static const int LOCAL = 0;
static const int CLIENT = 1;
static const int SERVER = 2;
Game();
~Game();
Client *getClient();
Server *getServer();
int getType();
void run(int type);
void setIp(std::string ip);
void setPort(int port);
void setPseudo(std::string pseudo);
void UpdatePlayerInfo(std::string name, sf::Vector3i color);
std::string getPseudo();
sf::Vector3i getColor();
void connect(std::string ip);
std::string getIpStr();
private:
sf::Thread *_server_thread;
Server *_s;
Client *_c;
bool _server_running;
sf::RenderWindow *_window;
ImageManager *_image_manager;
std::string _ip;
std::string _pseudo;
int _port;
int _type;
void runClient();
void runServer();
void startServer();
void stopServer();
void runLocal();
Screen *screens[6];
};
#endif /* _GAME_H_ */