Libsaki
Core library of Pancake Mahjong
Classes | Public Types | Public Member Functions | List of all members
saki::TileCount Class Reference

Classes

struct  Explain4Closed
 

Public Types

enum  AkadoraCount { AKADORA0, AKADORA3, AKADORA4 }
 

Public Member Functions

 TileCount (AkadoraCount fillMode)
 
 TileCount (std::initializer_list< T37 > t37s)
 
 TileCount (const TileCount &copy)=default
 
TileCountoperator= (const TileCount &assign)=default
 
int ct (T34 t) const
 
int ct (const T37 &t) const
 
int ct (Suit s) const
 
int ctAka5 () const
 
int ctZ () const
 
int ctYao () const
 
template<typename V >
int ct (const V &ts) const
 
bool has (Suit s) const
 
bool hasZ () const
 
bool hasYao () const
 
bool covers (const TileCount &that) const
 
void inc (const T37 &t, int delta)
 
void clear (T34 t)
 
TileCountoperator-= (const TileCount &rhs)
 
int step (int barkCt) const
 
int stepGb (int barkCt) const
 
int step4 (int barkCt) const
 
int step7 () const
 
int step7Gb () const
 
int step13 () const
 
bool hasEffA (int barkCt, T34 t) const
 
bool hasEffA4 (int barkCt, T34 t) const
 
bool hasEffA7 (T34 t) const
 
bool hasEffA13 (T34 t) const
 
util::Stactor< T34, 13 > t34s13 () const
 List all kind of tiles in this set. More...
 
util::Stactor< T37, 13 > t37s13 (bool allowDup=false) const
 List all tiles in this set. More...
 
bool dislike4 (T34 t) const
 Check if 't' is trivially not an effA4. More...
 
Parseds parse (int barkCt) const
 
Parsed4s parse4 (int barkCt) const
 Parse this hand as 4-meld shape with minimal shanten number. More...
 
Parsed7 parse7 () const
 
Parsed13 parse13 () const
 
std::vector< Explain4Closedexplain4 (T34 pick) const
 
bool onlyInTriplet (T34 pick, int barkCt) const
 
int sum (const std::vector< T34 > &ts) const
 
int sum () const
 
template<typename Ret , typename... Params, typename... Args>
Ret peekDraw (T34 t, Ret(TileCount::*f)(Params...) const, Args &&... args) const
 
template<typename Ret , typename... Params, typename... Args>
Ret peekDelta (T34 t, int delta, Ret(TileCount::*f)(Params...) const, Args &&... args) const
 

Member Function Documentation

◆ covers()

bool saki::TileCount::covers ( const TileCount that) const
Returns
true if 'that' is a subset of 'this'

◆ dislike4()

bool saki::TileCount::dislike4 ( T34  t) const

Check if 't' is trivially not an effA4.

Parameters
tThe tile to check
Returns
True only if (but not if) 't' is not an effA4

By 'trivial', we mean this tile does not connect with any existing tile, and by 'connect', we mean the numerical distance of two tiles are at most 2.

A disliked tile might be 'useful' in a pure-empty ready hand, But it is still not an effA4 since it does not decrease the return value of step4()

◆ parse4()

Parsed4s saki::TileCount::parse4 ( int  barkCt) const

Parse this hand as 4-meld shape with minimal shanten number.

Parameters
barkCtNumber of barks
Returns
A Parseds object representing all possible explanations

◆ t34s13()

util::Stactor< T34, 13 > saki::TileCount::t34s13 ( ) const

List all kind of tiles in this set.

Returns
At most 13 kind of tiles

Cause undefined behavior when this contains more than 13 kind of tiles.

◆ t37s13()

util::Stactor< T37, 13 > saki::TileCount::t37s13 ( bool  allowDup = false) const

List all tiles in this set.

Parameters
allowDupWhether to stop removing duplication in the result
Returns
At most 13 tiles

Cause undefined behavior when this contains more than 13 tiles.


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