Libsaki
Core library of Pancake Mahjong
table_view.h
1 #ifndef SAKI_TABLE_VIEW_H
2 #define SAKI_TABLE_VIEW_H
3 
4 #include "table_focus.h"
5 #include "../form/hand.h"
6 #include "../unit/who.h"
7 #include "../table/girl.h"
8 
9 
10 
11 namespace saki
12 {
13 
14 
15 
16 // A proxy accesser to prevent human or AI from knowing too
17 // much information, and also to impl tickets filters
18 class TableView
19 {
20 public:
21  explicit TableView(Who self) : mSelf(self) {}
22  TableView(const TableView &copy) = default;
23  virtual ~TableView() = default;
24 
25  Who self() const
26  {
27  return mSelf;
28  }
29 
30  virtual const Choices &myChoices() const = 0;
31  virtual const Girl &me() const = 0;
32  virtual const Hand &myHand() const = 0;
33  virtual int myRank() const = 0;
34 
35  virtual int getRound() const = 0;
36  virtual Who getDealer() const = 0;
37  virtual const TableFocus &getFocus() const = 0;
38  virtual const T37 &getFocusTile() const = 0;
39  virtual const util::Stactor<T37, 5> &getDrids() const = 0;
40  virtual const Rule &getRule() const = 0;
41  virtual int getSelfWind(Who who) const = 0;
42  virtual int getRoundWind() const = 0;
43  virtual TileCount visibleRemain() const = 0;
44  virtual Who findGirl(Girl::Id id) const = 0;
45 
46  virtual const River &getRiver(Who who) const = 0;
47  virtual const util::Stactor<M37, 4> &getBarks(Who who) const = 0;
48 
49  virtual bool genbutsu(Who whose, T34 t) const = 0;
50  virtual bool riichiEstablished(Who who) const = 0;
51  virtual bool isMenzen(Who who) const = 0;
52  virtual bool isAllLast() const = 0;
53  virtual bool inIppatsuCycle() const = 0;
54 
55 protected:
56  const Who mSelf;
57 };
58 
59 
60 
61 } // namespace saki
62 
63 
64 
65 #endif // SAKI_TABLE_VIEW_H
Definition: rule.h:13
Definition: table_focus.h:13
Definition: tile.h:25
Definition: tile_count.h:17
Choice set of one player.
Definition: choices.h:122
Definition: ai.cpp:18
Definition: table_view.h:18
Definition: hand.h:17
Definition: tile.h:353
Stactor = statically allocated vector.
Definition: stactor.h:247
Base class for skill implementation.
Definition: girl.h:35
Definition: who.h:14