-
Notifications
You must be signed in to change notification settings - Fork 13
Phase
Brandon Cooke edited this page Aug 6, 2019
·
2 revisions
A phase in smash.gg is a subset of matches and brackets inside an Event. For example, a wave in pools is a Phase. Everything in that Phase is a Group (or Phase Group).
const smashgg = require('smashgg.js');
const Phase = smashgg.Phase;
(async function(){
let phase1 = await Phase.get(111483);
console.log(phase1.getName()); // prints "Pools"
console.log(phase1.getNumSeeds()); // prints 156
let entrants = await phase1.getEntrants();
})()
Phase(
id: number,
name: string,
eventId: number,
numSeeds: number,
groupCount: number
)
-
id
- number
-
name
- string
-
eventId
- number
-
numSeeds
- number
-
groupCount
- number
-
async get(id)
- get a phase by numeric id
- parameters
- id
- number
- numeric id of the phase
- id
-
getId()
- gets the numeric identifier of this phase
- returns number
-
getEventId()
- gets the numeric identifier of the event which owns this phase
- returns number
-
getName()
- gets the name string of the phase
- returns string
-
getNumSeeds()
- gets the number of seeds that are in this phase
- returns number
-
getGroupCount()
- gets the number of phase groups belonging to this phase
- returns number
-
getPhaseGroups()
- gets the phase groups belonging to this phase
- returns: Promise<PhaseGroup[]>
-
getEntrants(options: IEntrant.EntrantOptions)
- gets the tournament attendees who competed in this phase
- parameters
- options
- EntrantOptions
- series of options for the return set of Entrants
- options
- returns Promise<Entrant[]>
-
getSets(options: IGGSet.SetOptions)
- gets the tournament sets that occurred in this phase
- parameters
- options
- SetOptions
- series of options for the return set of GGSet
- options
- returns Promise<GGSet[]>
-
getIncompleteSets(options: IGGSet.SetOptions)
- gets the tournament sets that occurred in this phase which are not completed
- parameters
- options
- SetOptions
- series of options for the return set of GGSet
- options
- returns Promise<GGSet[]>
-
getCompleteSets(options: IGGSet.SetOptions)
- gets the tournament sets that occurred in this phase which are completed
- parameters
- options
- SetOptions
- series of options for the return set of GGSet
- options
- returns Promise<GGSet[]>
-
getSetsXMinutesBack(minutesBack: number, options: IGGSet.SetOptions)
- gets the tournament sets that occurred in this phase which were completed x minutes ago
- parameters
- options
- SetOptions
- series of options for the return set of GGSet
- options
- returns Promise<GGSet[]>