Libsaki
Core library of Pancake Mahjong
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
saki::Girl Class Reference

Base class for skill implementation. More...

#include <girl.h>

Inheritance diagram for saki::Girl:
Inheritance graph
[legend]
Collaboration diagram for saki::Girl:
Collaboration graph
[legend]

Classes

class  IrsCtrlGetter
 Wrapper of a "T Girl::*" value where T implements IrsCtrl. More...
 

Public Types

enum  Id {
  DOGE = 0, CUSTOM = 1, MIYANAGA_TERU = 710111, HIROSE_SUMIRE = 710112,
  SHIBUYA_TAKAMI = 710113, MATANO_SEIKO = 710114, OOHOSHI_AWAI = 710115, MATSUMI_KURO = 712411,
  MATSUMI_YUU = 712412, ATARASHI_AKO = 712413, SAGIMORI_ARATA = 712414, TAKAKAMO_SHIZUNO = 712415,
  ONJOUJI_TOKI = 712611, NIJOU_IZUMI = 712612, EGUCHI_SERA = 712613, FUNAKUBO_HIROKO = 712614,
  SHIMIZUDANI_RYUUKA = 712615, USUZUMI_HATSUMI = 712714, IWATO_KASUMI = 712715, ANETAI_TOYONE = 712915,
  KATAOKA_YUUKI = 713311, SOMEYA_MAKO = 713312, TAKEI_HISA = 713313, HARAMURA_NODOKA = 713314,
  MIYANAGA_SAKI = 713315, NANPO_KAZUE = 713301, UESHIGE_SUZU = 713811, SUEHARA_KYOUKO = 713815,
  TSUJIGAITO_SATOHA = 715211, HAO_HUIYU = 715212, CHOI_MYEONGHWA = 715213, MEGAN_DAVIN = 715214,
  NELLY_VIRSALADZE = 715215, SHISHIHARA_SAWAYA = 714915, INAMURA_KYOUKA = 990001, SHIRATSUKI_SHINO = 990002,
  HONDOU_YUE = 990003, MIHOROGI_UTA = 990011, TAKUWA_RIO = 990014, KAJINO_YUI = 990024
}
 

Public Member Functions

 Girl (Who who, Id id)
 
 Girl (const Girl &copy)=default
 
Girloperator= (const Girl &assign)=delete
 
virtual std::unique_ptr< Girlclone () const
 
Id getId () const
 
virtual void onDice (util::Rand &rand, const Table &table)
 Called when someone is about to dice.
 
virtual void onMonkey (std::array< Exist, 4 > &exists, const Table &table)
 
virtual bool checkInit (Who who, const Hand &init, const Table &table, int iter)
 
virtual void onInbox (Who who, const Action &action)
 
virtual void onDraw (const Table &table, Mount &mount, Who who, bool rinshan)
 Called when someone is about to draw a tile from the mountain.
 
virtual void onChooseFirstDealer (util::Rand &rand, Who tempDealer, int &die1, int &die2)
 
virtual void onIrsChecked (const Table &table, Mount &mount)
 Called after self's IRS-check action.
 
virtual void onFlipKandoraIndic (const Table &table, Mount &mount)
 Called before flipping kandora indicator.
 
virtual void onDigUradoraIndic (const Table &table, Mount &mount, util::Stactor< Who, 4 > openers)
 Called after someone's win, before digging uradora indicator. More...
 
void onFilterChoice (const Table &table, Who who, ChoiceFilter &filter)
 Called on the choice-filtering stage.
 
void onActivateDice (const Table &table)
 Called when the dealer (self or not) is about to dice.
 
void onActivate (const Table &table)
 Called when self is about to be activated.
 
bool irsReady () const
 Whether the girl is ready to process an IRS action input. More...
 
const ChoicesirsChoices () const
 IRS choice set if IRS-ready, undefined otherwise. More...
 
virtual std::optional< HrhInitFixonHrhRaid (const Table &table)
 
virtual HrhBargaineronHrhBargain (const Table &table)
 
virtual std::optional< HrhInitFixonHrhBeg (util::Rand &rand, const Table &table, const TileCount &stock)
 
virtual std::string popUpStr () const
 
bool handleIrs (const Table &table, Mount &mount, const Action &action)
 Process an IRS action input. More...
 
- Public Member Functions inherited from saki::TableObserver
virtual void onTableEvent (const Table &table, const TableEvent &event)
 

Static Public Member Functions

static std::unique_ptr< Girlcreate (Who who, Id id)
 

Protected Member Functions

void accelerate (Mount &mount, const Hand &hand, const River &river, int delta)
 
virtual ChoiceFilter filterChoice (const Table &table, Who who)
 
virtual IrsCtrlGetter attachIrsOnDice ()
 Overriden to define a dice-time IRS's showing condition. More...
 
virtual IrsCtrlGetter attachIrsOnDrawn (const Table &table)
 Overriden to define a drawn-time IRS's showing condition. More...
 

Static Protected Member Functions

static void eraseRivered (util::Stactor< T34, 34 > &ts, const River &river)
 
static void eraseRivered (std::bitset< 34 > &ts, const River &river)
 

Protected Attributes

const Who mSelf
 
const Id mId
 

Detailed Description

Base class for skill implementation.

Girl's TableObserver callbacks will be called before ordinary observers. It is not needed to add girls to the observer vector when constructing a Table.

Member Function Documentation

◆ attachIrsOnDice()

Girl::IrsCtrlGetter saki::Girl::attachIrsOnDice ( )
protectedvirtual

Overriden to define a dice-time IRS's showing condition.

Returns
A valid IrsCtrlGetter if an IRS chance should be attached, nullptr if the ordinary Table flow should be taken.

Reimplemented in saki::Sawaya, saki::Awai, and saki::Kasumi.

◆ attachIrsOnDrawn()

Girl::IrsCtrlGetter saki::Girl::attachIrsOnDrawn ( const Table table)
protectedvirtual

Overriden to define a drawn-time IRS's showing condition.

Returns
A valid IrsCtrlGetter if an IRS chance should be attached, nullptr if the ordinary Table flow should be taken.

Reimplemented in saki::Sawaya, saki::Sumire, and saki::Toki.

◆ handleIrs()

bool saki::Girl::handleIrs ( const Table table,
Mount mount,
const Action action 
)

Process an IRS action input.

Returns
true if handled, false if the action should be handled by Table

◆ irsChoices()

const Choices & saki::Girl::irsChoices ( ) const

IRS choice set if IRS-ready, undefined otherwise.

Returns
The IRS choice set

◆ irsReady()

bool saki::Girl::irsReady ( ) const

Whether the girl is ready to process an IRS action input.

Returns
true if ready

◆ onDigUradoraIndic()

void saki::Girl::onDigUradoraIndic ( const Table table,
Mount mount,
util::Stactor< Who, 4 >  openers 
)
virtual

Called after someone's win, before digging uradora indicator.

Parameters
openersPlayers who opened their hand

Reimplemented in saki::Awai.


The documentation for this class was generated from the following files: