import { Glicko2 } from "https://deno.land/x/glicko2@v1.3.2/deno_dist/index.ts";
The main class of the rating system
Constructors
Properties
The internal default volatility algorithm used by the Glicko2 object when making new players
private
players: Record<string, Player>An object of all the players cached with their key as their id
Methods
private
_createInternalPlayer(rating?: number,
rd?: number,
vol?: number,
id?: number,
addMatch(): { pl1: Player; pl2: Player; }
player1: { rating: number; rd: number; vol: number; id: number; },
player2: { rating: number; rd: number; vol: number; id: number; },
outcome: matchResult | number,
Creates players and match result to be taken in account for the new rankings calculation players must have ids, they are not created if it has been done already.
getPlayers(): Record<string, Player>
getTeamMatches(match: teamMatch)
Gets an array of matches between 2 teams and their composite player object
makePlayer(): Player
rating?: number,
rd?: number,
vol?: number,
Creates a new Player and adds it to the cache We do not expose Glicko2._createInternalPlayer directly in order to prevent the assignation of a custom player id whose uniqueness could not be guaranteed
updateRatings(matches: (playerMatch | Race | teamMatch)[]): void
Gets all the matches from the race(if is an instance of one), calculates player ratings