summaryrefslogtreecommitdiff
path: root/server/game.h
diff options
context:
space:
mode:
Diffstat (limited to 'server/game.h')
-rw-r--r--server/game.h100
1 files changed, 1 insertions, 99 deletions
diff --git a/server/game.h b/server/game.h
index 2a736de..0c47917 100644
--- a/server/game.h
+++ b/server/game.h
@@ -7,11 +7,7 @@
#include <vector>
#include "wall.h"
-#include "client.h"
-#include "../common/action.h"
-#include "../common/set.h"
-#include "../common/state.h"
-#include "../common/cyclicint.h"
+#include "player.h"
class Game : public boost::enable_shared_from_this<Game> {
public:
@@ -22,100 +18,6 @@ class Game : public boost::enable_shared_from_this<Game> {
~Game();
private:
- typedef CyclicInt<4> PlayerNum;
-
- class Player {
- public:
- ClientBase::p client;
-
- Tiles hand;
- Sets open;
- Tiles pond;
- bool riichi;
- int score;
- int wind;
-
- //! Indexes of tiles that will give tenpai (used after riichi declaration).
- List<int> tenpai_indexes;
-
- //! Prepare for a new round.
- void round_start(int w);
-
- //! Get a state snapshot.
- PlayerState get_state();
-
- //! Get a state snapshot, with concealed tiles filtered.
- PlayerState get_state_filtered();
-
- //! Get possible actions after a draw.
- Actions get_actions_draw();
-
- //! Get possible actions on discarded tile.
- Actions get_actions_discard(Tile tile, PlayerNum discarder);
-
- typedef std::vector<int> Targets;
-
- //! Check if player can declare riichi.
- bool can_riichi();
-
- //! Check if tile can be called for a chi.
- Targets can_chi(Tile tile);
-
- //! Check if tile can be called for a pon.
- int can_pon(Tile tile);
-
- //! Check if it's possible to make a concealed kan.
- Targets can_kan();
-
- //! Check if it's possible to extend a pon to a kan.
- Targets can_kan_extend();
-
- //! Check if tile can be called to kan target.
- bool can_kan(Tile tile, int target);
-
- //! Check if hand is complete.
- bool can_tsumo();
-
- //! Check if tile can be called to complete hand.
- bool can_ron(Tile tile);
-
- //! Draw tile.
- void draw(Tile tile);
-
- //! Discard tile.
- void discard(int target);
-
- //! Look at last discard in pond.
- Tile last_discard();
-
- //! Claim last discard from pond.
- Tile claim();
-
- //! Declare riichi.
- void declare_riichi();
-
- //! Make chi from tile.
- void make_chi(Tile tile, int target);
-
- //! Make pon from tile.
- void make_pon(Tile tile, int target, PlayerNum discarder);
-
- //! Make open kan from tile.
- void make_kan(Tile tile, int target, PlayerNum discarder);
-
- //! Make concealed kan.
- void make_kan(int target);
-
- //! Make extended kan.
- void make_kan_extend(int target);
-
- //! Declare win on discarded tile.
- void declare_ron(Tile tile);
-
- //! Declare win on self-drawn tile.
- void declare_tsumo();
- };
-
Player players[4];
Wall wall;