yatzy v1.0.0 Yatzy.Player View Source
Module for player interactions
Link to this section Summary
Functions
Creating a new player with an empty score sheet.
Rolling the dice for the player
Saving the current roll in the score sheet
Calculating a user's total score
Link to this section Types
Link to this type
t()
View Sourcet() :: %Yatzy.Player{
current_roll: Yatzy.Roll.t(),
name: String.t(),
sheet: Yatzy.Sheet.t()
}
Link to this section Functions
Creating a new player with an empty score sheet.
Example
iex> Yatzy.Player.new("Bob")
%Yatzy.Player{name: "Bob", sheet: %Yatzy.Sheet{}, current_roll: %Yatzy.Roll{}}
Link to this function
roll(player, opts \\ [])
View Sourceroll(player :: t(), opts :: Yatzy.Roll.options()) :: t()
Rolling the dice for the player
Saving the current roll in the score sheet
Calculating a user's total score