#ifndef PLAYER_H #define PLAYER_H #include #include #include #include #include #include "connection.h" class Player : public boost::enable_shared_from_this { public: typedef boost::shared_ptr p; static p create(Connection::p c, boost::function f); private: Connection::p connection; boost::asio::deadline_timer timer; boost::function lobby_callback; boost::function ready_callback; std::string nick_; Player(Connection::p c, boost::function f); //! Start communicating. void start(); //! Handle Login-message. void handle_login(Message::p msg); //! Handle Ready-message. void handle_ready(Message::p msg); public: //! Return player's nick. std::string nick(); //! Notify client of a game start. void game_start(boost::function callback, std::vector players); }; #endif