summaryrefslogtreecommitdiff
path: root/server/game.h
diff options
context:
space:
mode:
Diffstat (limited to 'server/game.h')
-rw-r--r--server/game.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/server/game.h b/server/game.h
index 2574dc3..9c2513e 100644
--- a/server/game.h
+++ b/server/game.h
@@ -9,6 +9,7 @@
#include "wall.h"
#include "client.h"
#include "../common/action.h"
+#include "../common/state.h"
#include "gamevariant.h"
#include "standard.h"
@@ -23,6 +24,58 @@ class Game : public boost::enable_shared_from_this<Game> {
private:
std::vector<Client::p> players;
+ class Player {
+ public:
+ Client::p client;
+
+ Tiles hand;
+ Tiles open;
+ Tiles pond;
+ bool riichi;
+
+ //! Prepare for a new round.
+ void round_start();
+
+ //! Get a state snapshot.
+ State::Player get_state();
+
+ //! Get a state snapshot, with concealed tiles filtered.
+ State::Player 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);
+
+ typedef std::vector<int> Targets;
+
+ //! 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 or extend an open kan.
+ Targets can_kan();
+
+ // Check if tile can be called to kan target.
+ bool can_kan(Tile tile, int target);
+
+ //! 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();
+
+
+ };
int waiting_players;