#ifndef GAME_H #define GAME_H #include #include #include #include "wall.h" #include "player.h" class Game : public boost::enable_shared_from_this { public: typedef boost::shared_ptr p; static p create(ClientBase::p player_1, ClientBase::p player_2, ClientBase::p player_3, ClientBase::p player_4); ~Game(); private: Player players[4]; Wall wall; Tiles dora; bool kan_dora_pending; PlayerNum current_player; PlayerNum round_wind; PlayerNum round_num; int awaiting_players; Action preceding_action; int preceding_action_owner; Game(ClientBase::p player_1, ClientBase::p player_2, ClientBase::p player_3, ClientBase::p player_4); //! Handle Ready message from player. void handle_ready(); //! Start the game. void start(); //! Start a new round. void round_start(); //! Send update after a tile is drawn. void round_update_draw(); //! Send update after a tile is discarded. void round_update_discard(); //! Handle action after draw. void handle_action_draw(Action action); //! Handle actions after discard. void handle_action_discard(Action action, int player); enum Endcondition { Draw, Tsumo, Ron }; //! End the round. void round_end(Endcondition end); //! End the game void game_end(); }; #endif