Libsaki
Core library of Pancake Mahjong
senriyama_toki.h
1 #ifndef SAKI_GIRL_SENRIYAMA_TOKI_H
2 #define SAKI_GIRL_SENRIYAMA_TOKI_H
3 
4 #include "../table/irs_ctrl.h"
5 #include "../table/table_observer.h"
6 
7 #include <sstream>
8 
9 
10 
11 namespace saki
12 {
13 
14 
15 
16 class Toki : public GirlCrtp<Toki>
17 {
18 public:
20 
21  bool checkInit(Who who, const Hand &init, const Table &table, int iter) override;
22  void onDraw(const Table &table, Mount &mount, Who who, bool rinshan) override;
23  void onInbox(Who who, const Action &action) override;
24 
25  std::string popUpStr() const override;
26 
27 protected:
28  IrsCtrlGetter attachIrsOnDrawn(const Table &table) override;
29 
30 private:
31  class PredictCtrl : public IrsCtrlPlus<Toki>
32  {
33  public:
34  const Choices &choices() const override;
35  IrsResult handle(Toki &toki, const Table &table, Mount &mount, const Action &action) override;
36  void setClickHost(Choices normal);
37 
38  private:
39  Choices mChoices;
40  };
41 
42  enum class PopUpMode { OO, FV };
43 
44  static std::array<Girl::Id, 4> makeIdArray(const Table &table);
45 
46  IrsResult handleIrs(const Table &table, Mount &mount, const Action &action);
47  IrsResult handleIrsClick();
48  IrsResult handlePredict(const Table &table, Mount &mount, const Action &action);
49  void popUpBy(const Table &table, PopUpMode mode);
50 
51 private:
52  PredictCtrl mIrsCtrl;
53  bool mInFuture = false;
54  bool mCheckNextAction = false;
55  std::vector<Action> mRecords;
56  int mCd = 0;
57  PopUpMode mPopUpMode;
58  std::string mPredictResult;
59 };
60 
61 
62 
63 } // namespace saki
64 
65 
66 
67 #endif // SAKI_GIRL_SENRIYAMA_TOKI_H
void onDraw(const Table &table, Mount &mount, Who who, bool rinshan) override
Called when someone is about to draw a tile from the mountain.
Definition: senriyama_toki.cpp:483
Definition: irs_ctrl.h:43
Definition: mount.h:54
Definition: senriyama_toki.h:16
Definition: table.h:87
Choice set of one player.
Definition: choices.h:122
Definition: action.h:27
Definition: ai.cpp:18
Definition: hand.h:17
Wrapper of a "T Girl::*" value where T implements IrsCtrl.
Definition: girl.h:77
Definition: irs_ctrl.h:18
IrsCtrlGetter attachIrsOnDrawn(const Table &table) override
Overriden to define a drawn-time IRS&#39;s showing condition.
Definition: senriyama_toki.cpp:526
Definition: girl.h:212
Definition: who.h:14