ritchie/hand/dora

Dora counting. Dora are counted per indicator, plus red fives (aka dora). Ura dora only count when the winner declared riichi.

Types

pub type DoraHits {
  DoraHits(dora: Int, ura_dora: Int, aka_dora: Int)
}

Constructors

  • DoraHits(dora: Int, ura_dora: Int, aka_dora: Int)

Values

pub fn count(
  hand: tile_set37.TileSet37,
  melds: List(meld.Meld),
  winning_tile: tile.Tile,
  indicators: List(tile.Tile),
  ura_indicators: List(tile.Tile),
  riichi: Bool,
) -> DoraHits

Counts the dora in a winning hand. hand is the concealed hand before the win and winning_tile the tile that completed it. indicators should include every revealed dora indicator (including kan dora); ura_indicators is only counted when riichi is true. Red fives count both as their normal five for dora and as aka dora.

pub fn total(hits: DoraHits) -> Int

Total dora han.

✨ Search Document