yatzy v1.0.0 Yatzy.Game View Source
Game module responsible for :
- starting a new game
- delegating player interactions based on game's turn
- finishing a game
Link to this section Summary
Functions
Finish the game and calculate the results
Create a new game with a list of players
(Re)Rolling the dice for a given player
Saving a player's current roll and ending that player's turn.
Link to this section Types
Link to this type
t()
View Sourcet() :: %Yatzy.Game{
current_player: String.t() | nil,
players: %{required(String.t()) => Yatzy.Player.t()} | nil,
result: :pending | Yatzy.Result.t()
}
Link to this section Functions
Finish the game and calculate the results
Create a new game with a list of players
Link to this function
roll(game, player_name, opts \\ [])
View Sourceroll(game :: t(), player_name :: String.t(), opts :: Yatzy.Roll.options()) :: t()
(Re)Rolling the dice for a given player
Saving a player's current roll and ending that player's turn.