Libsaki
Core library of Pancake Mahjong
Classes | Public Types | Public Member Functions | List of all members
saki::Table Class Reference
Inheritance diagram for saki::Table:
Inheritance graph
[legend]
Collaboration diagram for saki::Table:
Collaboration graph
[legend]

Classes

struct  InitConfig
 

Public Types

enum  CheckResult { OK, EXPIRED, ILLEGAL }
 

Public Member Functions

 Table (InitConfig config, std::vector< TableObserver *> obs, const TableEnv &env)
 Create a new table. More...
 
 Table (const Table &orig, std::vector< TableObserver *> obs)
 Clone a table and replace all its observers.
 
 Table (const Table &copy)=delete
 
Tableoperator= (const Table &assign)=delete
 
void start ()
 Start the table.
 
void action (Who who, const Action &act, int nonce)
 Input an action to the table.
 
CheckResult check (Who who, const Action &action, int nonce) const
 Validate a user input.
 
const HandgetHand (Who who) const
 
const RivergetRiver (Who who) const
 
const GirlgetGirl (Who who) const
 
std::unique_ptr< TableViewgetView (Who who) const
 
const FuritengetFuriten (Who who) const
 
const std::array< int, 4 > & getPoints () const
 
int getRound () const
 
int getExtraRound () const
 
TileCount visibleRemain (Who who) const
 
int riverRemain (T34 t) const
 
int getRank (Who who) const
 Get the ranking of a player. More...
 
const TableFocusgetFocus () const
 
const T37getFocusTile () const
 
bool genbutsu (Who whose, T34 t) const
 
bool lastDiscardLay () const
 
bool riichiEstablished (Who who) const
 
bool duringKan () const
 
bool isAllLast () const
 
bool beforeEast1 () const
 
bool inIppatsuCycle () const
 
bool anyActivated () const
 Checks if the table is waiting for any user input. More...
 
Who findGirl (Girl::Id id) const
 
Who getDealer () const
 
int getDice () const
 Get the sum of the two dice numbers of this round. More...
 
int getDeposit () const
 
int getSelfWind (Who who) const
 
int getRoundWind () const
 
int getNonce (Who who) const
 
const RulegetRule () const
 
FormCtx getFormCtx (Who who) const
 Get the context for counting the points of a hand. More...
 
const ChoicesgetChoices (Who who) const
 
const MountgetMount () const
 
const TableEnvgetEnv () const
 
void popUp (Who who) const
 Pop up extra texts onto the screen. More...
 

Constructor & Destructor Documentation

◆ Table()

Table::Table ( InitConfig  config,
std::vector< TableObserver *>  obs,
const TableEnv env 
)
explicit

Create a new table.

Parameters
configInitial configuration
obsObservers
envEnvironment provider

Member Function Documentation

◆ anyActivated()

bool Table::anyActivated ( ) const

Checks if the table is waiting for any user input.

Returns
true iff waiting

◆ beforeEast1()

bool Table::beforeEast1 ( ) const
Returns
true iff the very first has not started yet

◆ duringKan()

bool Table::duringKan ( ) const
Returns
true iff someone is performing a kan

◆ genbutsu()

bool Table::genbutsu ( Who  whose,
T34  t 
) const
Deprecated:
Will be replaced by TableMirror and AiMemo

◆ getDice()

int Table::getDice ( ) const

Get the sum of the two dice numbers of this round.

Returns
The dice sum

◆ getFormCtx()

FormCtx Table::getFormCtx ( Who  who) const

Get the context for counting the points of a hand.

Parameters
whoThe player whose hand is to be calculated
Returns
The form context

◆ getRank()

int Table::getRank ( Who  who) const

Get the ranking of a player.

Parameters
whoThe player
Returns
1 ~ 4

◆ lastDiscardLay()

bool Table::lastDiscardLay ( ) const
Returns
true if the last discard is a riichi-declaring tile or its replacing marker

◆ popUp()

void Table::popUp ( Who  who) const

Pop up extra texts onto the screen.

Parameters
whoPlayer to whom the text is visible

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