glicko v0.2.0 Glicko.Result
A convenience wrapper representing a result against an opponent.
Usage
iex> opponent = Player.new_v2
iex> Result.new(opponent, 0.0)
%Result{score: 0.0, opponent: %Player{version: :v2, rating: 0.0, rating_deviation: 2.014761872416068, volatility: 0.06}}
iex> Result.new(opponent, :win) # With shortcut
%Result{score: 1.0, opponent: %Player{version: :v2, rating: 0.0, rating_deviation: 2.014761872416068, volatility: 0.06}}
Link to this section Summary
Functions
Creates a new Result against an opponent
Link to this section Types
Link to this type
t()
t() :: %Glicko.Result{opponent: Glicko.player_t() | Glicko.Player.t(), score: Glicko.score_t()}
Link to this section Functions
Link to this function
new(opponent, result_type)
new(opponent :: Glicko.player_t() | Glicko.Player.t(), result_type_t() | float()) :: t()
Creates a new Result against an opponent.
Supports passing either :loss, :draw, or :win as shortcuts.