Libsaki
Core library of Pancake Mahjong
table_focus.h
1 #ifndef SAKI_TABLEFOCUS_H
2 #define SAKI_TABLEFOCUS_H
3 
4 #include "../unit/who.h"
5 
6 
7 
8 namespace saki
9 {
10 
11 
12 
14 {
15 public:
16  Who who() const
17  {
18  return mWho;
19  }
20 
24  bool isDiscard() const
25  {
26  return mBarkId == -1;
27  }
28 
29  int barkId() const
30  {
31  return mBarkId;
32  }
33 
34  unsigned uBarkId() const
35  {
36  return static_cast<unsigned>(mBarkId);
37  }
38 
39  void focusOnDiscard(Who who)
40  {
41  mWho = who;
42  mBarkId = -1;
43  }
44 
45  void focusOnChankan(Who who, int barkId)
46  {
47  mWho = who;
48  mBarkId = barkId;
49  }
50 
51 private:
52  Who mWho;
53  int mBarkId;
54 };
55 
56 
57 
58 } // namespace saki
59 
60 
61 
62 #endif // SAKI_TABLEFOCUS_H
Definition: table_focus.h:13
bool isDiscard() const
Definition: table_focus.h:24
Definition: ai.cpp:18
Definition: who.h:14