blob: f950b645f289ae891e67b02dc3adc250a198da2a (
plain)
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
|
#ifndef GAME_H
#define GAME_H
#include "scene.h"
#include <boost/asio.hpp>
#include <string>
class Game {
private:
static Game *game;
Scene *scene;
boost::asio::io_service io_service;
boost::asio::ip::tcp::socket socket;
public:
Game();
~Game();
void run(std::string host, unsigned int port);
void run(std::string host, std::string port);
void async_read();
void handle_message(const boost::system::error_code& error, std::size_t bytes_transferred, uint8_t *type);
void handle_chunk();
static Game& get_instance();
};
#endif
|