summaryrefslogtreecommitdiff
path: root/game.h
diff options
context:
space:
mode:
Diffstat (limited to 'game.h')
-rw-r--r--game.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/game.h b/game.h
new file mode 100644
index 0000000..f950b64
--- /dev/null
+++ b/game.h
@@ -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