UNPKG

brawl-api-wrapper

Version:

An API wrapper for the well know supercell game called Brawl Stars

29 lines (28 loc) 908 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Club = void 0; const ClubMember_1 = require("./ClubMember"); class Club { constructor(data, client) { this.tag = data.tag; this.name = data.name; this.description = data.description; this.type = data.type; this.badgeId = data.badgeId; this.requiredTrophies = data.requiredTrophies; this.trophies = data.trophies; this.members = data.members.map((x) => new ClubMember_1.ClubMember(x, client)); this.memberCount = this.members.length; } sortClubMembersByTrophies(type) { return this.members.sort((a, b) => { if (type === 'DESCENDING') { return a.trophies - b.trophies; } else { return b.trophies - a.trophies; } }); } } exports.Club = Club;