diff options
Diffstat (limited to 'game.h')
-rw-r--r-- | game.h | 32 |
1 files changed, 32 insertions, 0 deletions
@@ -0,0 +1,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 |