ritchie/elements/meld/pon

An open group of 3 identical (ignoring red) tiles. May be called from any other player’s discard.

Types

Pon meld. Takes:

  • own: The calling player’s own 2 tiles.
  • called: The called tile.
  • dir: (discarding_player - self) mod 4
pub type Pon {
  Pon(
    own: List(tile.Tile),
    called: tile.Tile,
    dir: player.Player,
  )
}

Constructors

Values

pub fn consume_from_hand(
  p: Pon,
  hand: tile_set37.TileSet37,
) -> tile_set37.TileSet37

Removes own tiles from player’s closed hand.

pub fn from_tiles_dir(
  own0: tile.Tile,
  own1: tile.Tile,
  called: tile.Tile,
  dir: player.Player,
) -> option.Option(Pon)

Constructs from own tiles, called tile, and the relative position of the discarding player.

pub fn is_in_hand(p: Pon, hand: tile_set37.TileSet37) -> Bool

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

pub fn num(p: Pon) -> Int
pub fn suit(p: Pon) -> Int
✨ Search Document