Class representing a player.

Hierarchy

Constructors

Properties

clan?: STClan

The clan the player is in, if the player is in a clan.

country?: STCountry

The country the player is from.

duels?: STWinStats

Information about the player's duelling history. Wins, losses, ties, and total number of duels played.

elo?: number

The player's elo. In the SauerTracker code on GitHub, I found what I assume to be the elo calculating function. What I interpret from this:

  1. Every player starts with a base elo (1200 by default), and this elo is then mutated after duels.
  2. Only duels where both players have at least one frag impact elo.
  3. The elo is changed depending on the ratio of frags and elo between the player and opponent, as well as the base elo.
  4. Assuming the game passed the above checks and the frags property of self and opp is for this particular game, the new elo of self after dueling opp is increased or decreased by the rounded result of
10 * (log(self.frags / opp.frags) + log(opp.elo / self.elo)) * (self.elo / baseElo)
fetched: boolean = false

True if the class was fetched

latestGames?: STGame[]

An array of the last ten games played.

name: string

The name of the player.

online?: boolean

True if the player is on a server.

rank?: number

The player's rank.

The player's statistics.

totalGames?: number

The total number of games this player has played.

Methods

  • Fetches the data from the API, filling out the current object. This should be an asynchronous function.

    Returns

    This object after fetching

    Returns Promise<STPlayer>

  • Fetches activity data for the player

    Returns Promise<STActivity[]>

  • isFetched(): boolean
  • Returns

    True if this object is fetched

    Returns boolean

  • Sets properties based on the response sent from a request

    Returns

    This object after setting properties

    Parameters

    • data: any

      The response data from the API

    Returns STPlayer

  • find(name?: string, country?: string): Promise<STPlayer[]>
  • Find up to 200 players matching a given query

    Returns

    an array of up to 200 players that match the query.

    Parameters

    • name: string = ""

      The name to match, or an empty string to not match any name.

    • country: string = ""

      A country abbreviation, such as CA for Canada.

    Returns Promise<STPlayer[]>

Generated using TypeDoc