import { APIPlayer } from "../_interfaces/interfaces"; /** * Represents a brawler in the game. * @interface * @property {number} rank - The rank of the brawler. * @property {number} trophies - The number of trophies earned by the brawler. * @property {number} highestTrophies - The highest number of trophies earned by the brawler. * @property {number} power - The power level of the brawler. * @property {number} countStarPowers - The number of star powers owned by the brawler. * @property {number} countGadgets - The number of gadgets owned by the brawler. * @property {number} countGears - The number of gears owned by the brawler. */ export interface Brawler { rank: number; trophies: number; highestTrophies: number; power: number; countStarPowers: number; countGadgets: number; countGears: number; } /** * A class representing a player in the game. * @class Player */ export default class Player { /** * The player's tag. * @type {string} */ tag: string; /** * The player's name. * @type {string} */ name: string; /** * The player's current number of trophies. * @type {number} */ trophies: number; /** * The player's highest number of trophies achieved. * @type {number} */ highestTrophies: number; /** * The player's highest number of trophies achieved. * @type {{trio: number, duo: number, solo: number}}; */ victories: { [key: string]: number; trio: number; duo: number; solo: number; }; /** * An object containing the player's club information. * @type {{tag: string, name: string}}; */ club: { tag: string; name: string; }; /** * An object containing information about each brawler the player has. * @type { Brawler[] } */ brawlers: { [key: string]: Brawler; }; /** * Creates a new `Player` instance from an API response. * @param {APIPlayer} api The API response containing player data. * @constructor */ constructor(api: APIPlayer); /** * Returns the total number of wins the player has across all game modes. * @returns {number} The total number of wins. */ wins(): number; /** * Returns the player's brawler with the specified name. * @param {string} name The name of the brawler to retrieve. * @returns {(null | Brawler)} The brawler, or `null` if the brawler with the specified name does not exist. */ brawler(name: string): null | Brawler; }