4 #include "../table/mount.h" 5 #include "../table/table_observer.h" 6 #include "../table/choices.h" 8 #include "../util/misc.h" 44 MIYANAGA_TERU = 710111, HIROSE_SUMIRE = 710112, SHIBUYA_TAKAMI = 710113,
45 MATANO_SEIKO = 710114, OOHOSHI_AWAI = 710115,
46 MATSUMI_KURO = 712411, MATSUMI_YUU = 712412, ATARASHI_AKO = 712413,
47 SAGIMORI_ARATA = 712414, TAKAKAMO_SHIZUNO = 712415,
48 ONJOUJI_TOKI = 712611, NIJOU_IZUMI = 712612, EGUCHI_SERA = 712613,
49 FUNAKUBO_HIROKO = 712614, SHIMIZUDANI_RYUUKA = 712615,
52 USUZUMI_HATSUMI = 712714, IWATO_KASUMI = 712715,
53 ANETAI_TOYONE = 712915,
54 KATAOKA_YUUKI = 713311, SOMEYA_MAKO = 713312, TAKEI_HISA = 713313,
55 HARAMURA_NODOKA = 713314, MIYANAGA_SAKI = 713315,
57 UESHIGE_SUZU = 713811, SUEHARA_KYOUKO = 713815,
58 TSUJIGAITO_SATOHA = 715211, HAO_HUIYU = 715212, CHOI_MYEONGHWA = 715213,
59 MEGAN_DAVIN = 715214, NELLY_VIRSALADZE = 715215,
60 SHISHIHARA_SAWAYA = 714915,
63 INAMURA_KYOUKA = 990001, SHIRATSUKI_SHINO = 990002, HONDOU_YUE = 990003,
64 MIHOROGI_UTA = 990011, TAKUWA_RIO = 990014,
80 template<
typename IrsCtrlImpl,
typename GirlImpl>
81 static IrsCtrlImpl
Girl::*upcast(IrsCtrlImpl GirlImpl::*mem)
83 return static_cast<IrsCtrlImpl
Girl::*
>(mem);
86 template<
typename IrsCtrlImpl,
typename GirlImpl>
88 : mImpl(mem ==
nullptr ?
nullptr : std::make_unique<Impl<IrsCtrlImpl>>(upcast(mem)))
97 : mImpl(copy.mImpl ==
nullptr ?
nullptr : copy.mImpl->clone())
102 : mImpl(std::move(move.mImpl))
108 mImpl = std::move(that.mImpl);
114 return mImpl !=
nullptr;
119 return mImpl->get(girl);
126 virtual ~ImplBase() =
default;
127 virtual std::unique_ptr<ImplBase> clone() = 0;
131 template<
typename IrsCtrlType>
132 class Impl :
public ImplBase
135 Impl(IrsCtrlType
Girl::*ptrToMem)
136 : mPtrToMem(ptrToMem)
140 std::unique_ptr<ImplBase> clone()
override 142 return std::make_unique<Impl>(*this);
147 return girl.*mPtrToMem;
151 IrsCtrlType
Girl::*mPtrToMem;
155 std::unique_ptr<ImplBase> mImpl;
158 static std::unique_ptr<Girl> create(
Who who, Id
id);
161 ~
Girl()
override =
default;
163 Girl &operator=(
const Girl &assign) =
delete;
165 virtual std::unique_ptr<Girl> clone()
const;
170 virtual void onMonkey(std::array<Exist, 4> &exists,
const Table &table);
171 virtual bool checkInit(
Who who,
const Hand &init,
const Table &table,
int iter);
172 virtual void onInbox(
Who who,
const Action &action);
174 virtual void onChooseFirstDealer(
util::Rand &rand,
Who tempDealer,
int &die1,
int &die2);
186 virtual std::optional<HrhInitFix> onHrhRaid(
const Table &table);
190 virtual std::string popUpStr()
const;
196 static void eraseRivered(std::bitset<34> &ts,
const River &river);
197 void accelerate(
Mount &mount,
const Hand &hand,
const River &river,
int delta);
211 template<
typename Derived>
217 std::unique_ptr<Girl> clone()
const final 220 return std::make_unique<Derived>(
static_cast<const Derived &
>(*this));
222 static_assert(False<Derived>::value,
"Must follow CRTP");
226 template<
typename T>
struct False : std::false_type {};
235 #endif // SAKI_GIRL_H virtual void onFlipKandoraIndic(const Table &table, Mount &mount)
Called before flipping kandora indicator.
Definition: girl.cpp:137
Definition: lobject.h:497
Interface for working with the 'bargain' stage.
Definition: princess.h:38
virtual IrsCtrlGetter attachIrsOnDrawn(const Table &table)
Overriden to define a drawn-time IRS's showing condition.
Definition: girl.cpp:288
virtual void onDice(util::Rand &rand, const Table &table)
Called when someone is about to dice.
Definition: girl.cpp:93
virtual void onDraw(const Table &table, Mount &mount, Who who, bool rinshan)
Called when someone is about to draw a tile from the mountain.
Definition: girl.cpp:116
void onFilterChoice(const Table &table, Who who, ChoiceFilter &filter)
Called on the choice-filtering stage.
Definition: girl.cpp:154
virtual void onIrsChecked(const Table &table, Mount &mount)
Called after self's IRS-check action.
Definition: girl.cpp:129
const Choices & irsChoices() const
IRS choice set if IRS-ready, undefined otherwise.
Definition: girl.cpp:196
virtual IrsCtrlGetter attachIrsOnDice()
Overriden to define a dice-time IRS's showing condition.
Definition: girl.cpp:278
Definition: tile_count.h:17
Choice set of one player.
Definition: choices.h:122
Definition: choices.h:100
Definition: irs_ctrl.h:29
Definition: table_observer.h:23
void onActivate(const Table &table)
Called when self is about to be activated.
Definition: girl.cpp:171
bool irsReady() const
Whether the girl is ready to process an IRS action input.
Definition: girl.cpp:187
virtual void onDigUradoraIndic(const Table &table, Mount &mount, util::Stactor< Who, 4 > openers)
Called after someone's win, before digging uradora indicator.
Definition: girl.cpp:146
Wrapper of a "T Girl::*" value where T implements IrsCtrl.
Definition: girl.h:77
bool handleIrs(const Table &table, Mount &mount, const Action &action)
Process an IRS action input.
Definition: girl.cpp:231
Stactor = statically allocated vector.
Definition: stactor.h:247
Base class for skill implementation.
Definition: girl.h:35
void onActivateDice(const Table &table)
Called when the dealer (self or not) is about to dice.
Definition: girl.cpp:162