1 #ifndef SAKI_TABLE_EVENT_H 2 #define SAKI_TABLE_EVENT_H 4 #include "../form/form.h" 5 #include "../unit/action.h" 6 #include "../util/misc.h" 17 enum class RoundResult
20 TSUMO, RON, HP, KSKP, SFRT, SKSR, SCRC, SCHR, NGSMG, ABORT, NUM_ROUNDRES
29 TABLE_STARTED, FIRST_DEALER_CHOSEN, ROUND_STARTED, CLEANED,
30 DICED, DEALT, FLIPPED, DRAWN, DISCARDED,
31 RIICHI_CALLED, RIICHI_ESTABLISHED, BARKED, ROUND_ENDED,
32 POINTS_CHANGED, TABLE_ENDED, POPPED_UP
37 virtual ~
Args() =
default;
38 virtual std::unique_ptr<Args> clone() = 0;
41 template<
typename ArgsT>
46 std::unique_ptr<Args> clone()
override 48 return std::make_unique<ArgsCloneable>(*this);
56 static const Type TYPE = Type::TABLE_STARTED;
62 static const Type TYPE = Type::FIRST_DEALER_CHOSEN;
68 static const Type TYPE = Type::ROUND_STARTED;
79 static const Type TYPE = Type::CLEANED;
84 static const Type TYPE = Type::DICED;
91 static const Type TYPE = Type::DEALT;
96 static const Type TYPE = Type::FLIPPED;
101 static const Type TYPE = Type::DRAWN;
107 static const Type TYPE = Type::DISCARDED;
113 static const Type TYPE = Type::RIICHI_CALLED;
119 static const Type TYPE = Type::RIICHI_ESTABLISHED;
125 static const Type TYPE = Type::BARKED;
133 static const Type TYPE = Type::ROUND_ENDED;
142 static const Type TYPE = Type::POINTS_CHANGED;
147 static const Type TYPE = Type::TABLE_ENDED;
148 std::array<Who, 4> ranks;
149 std::array<int, 4> scores;
154 static const Type TYPE = Type::POPPED_UP;
158 template<
typename ArgsT>
169 , mArgs(copy.mArgs->clone())
178 template<
typename ArgsT>
179 const ArgsT &as()
const 181 assert(mType == ArgsT::TYPE);
187 std::unique_ptr<Args> mArgs;
196 #endif // SAKI_TABLE_EVENT_H Definition: table_event.h:60
Definition: table_event.h:23
Definition: table_event.h:82
Definition: table_event.h:35
Definition: table_event.h:77
Definition: table_event.h:131
Definition: table_event.h:140
Definition: table_event.h:94
Definition: table_event.h:145
Definition: table_event.h:66
Definition: table_event.h:105
Definition: table_event.h:42
Definition: table_event.h:99
M37 bark
M37 param is required to denote kakan.
Definition: table_event.h:127
Definition: table_event.h:89
Definition: table_event.h:123
Definition: table_event.h:117
Definition: table_event.h:152
Stactor = statically allocated vector.
Definition: stactor.h:247
Definition: table_event.h:54
Definition: table_event.h:111