View Source Briscola.Player (Briscola v0.1.0)
Struct for a player in the game of Briscola. Players have a hand of playing cards and a pile of won cards. The pile of won cards is used for scoring.
Summary
Functions
Create a new player.
Remove a specific card from a player's hand.
Calculate the score of a player. The score is the sum of the scores of the cards in the player's pile.
Types
@type t() :: %Briscola.Player{hand: [Briscola.Card.t()], pile: [Briscola.Card.t()]}
Functions
@spec new() :: t()
Create a new player.
@spec remove_from_hand(t(), Briscola.Card.t()) :: t()
Remove a specific card from a player's hand.
Calculate the score of a player. The score is the sum of the scores of the cards in the player's pile.