import { Agent } from '../../Agent' ; import { Player } from '..' ; /**
 * Abstract Rank system class, that takes in generic types for configurations and a rank state
 */ export abstract class RankSystem < Configs , RankState > { abstract configs : Configs ; constructor ( ) { } /**
     * Given a rank state, reset it and return the new rank state
     */ abstract resetRank ( rankState ) ; /**
     * Given an array of rank states and parallel array of the rankings each of the players associated with the rank
     * states received, return a new array of updated rank states in the same order.
     */ abstract updateRanks ( rankStates , relativeRanks ) ; /**
     * Initialize rank state from scratch. Returns the rank state for new players to the tournament
     */ abstract initializeRankState ( ) ; param rankState abstract onPlayerUpdate ( rankState ) ; /**
     * Compare two rank states and return 0 if they are of equivalent rank, return a negative number
     * if rankState1 < rankState2 and negative otherwise. Effectiely sort in descending rank with rank 1 being highest
     */ abstract rankComparator ( rankState1 , rankState2 ) ; /**
     * For terminal live display of ladder tournament. This forms the header of the table
     */ abstract getRankStatesHeaderString ( ) ; /**
     * For terminal live display of ladder tournaments. This forms the row of the table given a rank state
     */ abstract getRankStateString ( player , rankState , matchesPlayed ) ; } import * as TS from './TrueSkillSystem' ; import * as EL from './ELOSystem' ; import * as WS from './WinsSystem' ; /**
 * Rank System enums and namespaces for the kind of ranking systems you can choose for a  Tournament export namespace RankSystem { export import TrueSkillSystem = TS . TrueSkillSystem ; export import TrueSkill = TS . TrueSkill ; export import ELOSystem = EL . ELOSystem ; export import ELO = EL . ELO ; export import Wins = WS . Wins ; export import WinsSystem = WS . WinsSystem ; /** The results interface that must be returned by a result handler for a  Tournament export interface Results { /**
         * Array of  Agent . ID s and their ranks in a  Match . ranks can be the same number of players
         * are considered to have tied or achieved equal standing
          ranks : Array < { rank : number ; agentID : Agent . ID ; } > ; } }