ritchie/elements/meld/chii

An open group of 3 consecutive tiles. The called tile may only come from the previous player’s discard.

Types

Chii meld. Takes:

  • own: The calling player’s own 2 tiles.
  • called: The called tile.
  • min: The smallest tile (ignoring red) in the group.
pub type Chii {
  Chii(own: List(tile.Tile), called: tile.Tile, min: tile.Tile)
}

Constructors

Values

pub fn consume_from_hand(
  c: Chii,
  hand: tile_set37.TileSet37,
) -> tile_set37.TileSet37

Removes own tiles from player’s closed hand.

pub fn dir(c: Chii) -> Int
pub fn from_tiles(
  own0: tile.Tile,
  own1: tile.Tile,
  called: tile.Tile,
) -> option.Option(Chii)

Constructs Chii from own tiles and the called tile.

pub fn is_in_hand(c: Chii, hand: tile_set37.TileSet37) -> Bool

Checks whether own tiles exist in player’s closed hand.

pub fn suit(c: Chii) -> Int
✨ Search Document