Riichi.Engine.State (riichi v0.2.0)

Copy Markdown View Source

Internal Defines the structure of the state backing the game state machine

Summary

Types

t()

@type t() :: %Riichi.Engine.State{
  actor: Riichi.Actor.t() | nil,
  after_a_kan?: boolean() | nil,
  bonus_sticks: non_neg_integer() | nil,
  dora_indicator_count: non_neg_integer() | nil,
  first_chance?: boolean() | nil,
  has_pending_kandora?: boolean() | nil,
  last_event: (Riichi.Event.t() | nil) | nil,
  players: %{required(Riichi.Actor.t()) => Riichi.Player.t()} | nil,
  queued_actions: %{required(Riichi.Actor.t()) => Riichi.Action.t()},
  riichi_bets: non_neg_integer() | nil,
  round_id: Riichi.Round.round_id() | nil,
  round_result: (Riichi.Engine.State.RoundResult.t() | nil) | nil,
  rules: Riichi.Rules.t() | nil,
  valid_actions: %{required(Riichi.Actor.t()) => [Riichi.Action.t()]},
  wall: Riichi.Wall.t() | nil
}

Functions

after_discard(state)

(macro)

after_draw(state)

(macro)

has_four_kans(state)

@spec has_four_kans(t()) :: boolean()

is_four_kan_draw(state)

@spec is_four_kan_draw(t()) :: boolean()

is_four_riichi_draw(state)

@spec is_four_riichi_draw(t()) :: boolean()

is_four_wind_draw(state)

@spec is_four_wind_draw(t()) :: boolean()

kan_counts(state)

@spec kan_counts(t()) ::
  {total :: non_neg_integer(), kan_player_count :: non_neg_integer()}

scoring_for_actor(state, actor)

@spec scoring_for_actor(t(), Riichi.Actor.t()) :: Riichi.Scoring.t() | nil