-
Notifications
You must be signed in to change notification settings - Fork 13
Tournament
Brandon Cooke edited this page Aug 6, 2019
·
6 revisions
A Tournament in smash.gg is a collection of Events, Phases, and Phases Groups that categorize different games played, game types within those games, and the matches that make up those games.
const smashgg = require('smashgg.js');
const Tournament = smashgg.Tournament;
(async function(){
let ceo2016 = await Tournament.getTournament('ceo2016');
console.log(ceo2016.getName());
let ceoEvents = await Tournament.getEvents();
let phases = await Tournament.getPhases();
let phaseGroups = await Tournament.getPhaseGroups();
})();
Tournament(
id: number,
name: string,
slug: string,
startTime: Date | null,
endTime: Date | null,
timezone: string | null,
venue: Venue,
organizer: Organizer
)
-
id
- number
- id number of the tournament
-
name
- string
- name of the tournament
-
slug
- string
- url slug of the tournament
-
startTime
- Date | null
- start time unix epoch of the tournament
-
endTime
- Date | null
- end time unix epoch of the tournament
-
timezone
- string | null
- timezone of the location of the tournament
-
venue
- Venue
- contains information about the Venue (see Venue docs)
-
organizer
- Organizer
- contains information about the Organizer (see Organizer docs)
-
async get(slug)
- get a tournament object
- parameters
- slug
- string
- shorthand or tournament slug-name in smashgg
- ceo-2016 or function-1-recursion-regional
- shorthand: to12 instead of tipped-off-12-presented-by-the-lab-gaming-center
- slug
- returns Promise<Tournament>
-
async getById(id)
- get a tournament object
- parameters
- id
- number
- numeric identifier of the tournament
- id
- returns Promise<Tournament>
-
async searchAttendees(smashtag)
- get a list of Attendees that contain the given smashtag in their gamertag
- parameters
- smashtag
- string
- the smashtag you are searching for, or a subset of characters from it
- smashtag
- returns a Promise resolving a List of Attendee objects, or null if no match
-
async searchAttendeesBySponsorTag(sponsorTag)
- get a list of Attendees that contain the given sponsor tag in their profile
- parameters
- sponsorTag
- string
- the sponsor tag you are searching for, or a subset of characters from it
- sponsorTag
- returns a Promise resolving a List of Attendee objects, or null if no match
-
getId()
- gets the id property of the tournament
- returns number
-
getName()
- gets the name property of the tournament
- returns string
-
getSlug()
- gets the slug property of the tournament
- returns string
-
getTimezone()
- gets the timezone property of the tournament
- returns string | null
-
getStartTime()
- gets the start time property of the tournament in JS Date object
- returns Date | null
-
getStartTimeString()
- gets the start time property of the tournament in Date string
- returns string | null
-
getEndTime()
- gets the end time property of the tournament in JS Date object
- returns Date | null
-
getEndTimeString()
- gets the end time property of the tournament in Date string
- returns string | null
-
getVenue()
- gets the Venue object where this tournament takes place
- returns Venue
-
getVenueName()
- gets the venue name where this tournament takes place
- returns string | null
-
getCity()
- gets the city string where this tournament takes place
- returns string | null
-
getState()
- gets the state string where this tournament takes place
- returns string | null
-
getAddress()
- gets the address string where this tournament takes place
- returns string | null
-
getZipCode()
- gets the zip code string where this tournament takes place
- returns string | null
-
getOrganizer()
- gets the Organizer object who organized this tournament
- returns Organizer
-
getContactInfo()
- gets the contact info of the organizer
- returns string | null
-
getContactEmail()
- gets the email string of the organizer
- returns string | null
-
getContactTwitter()
- gets the twitter handle string of the organizer
- returns string | null
-
getOwnerId()
- get the numeric id of the owner's player profile
- returns number | null
-
getEvents()
- aggregates all of the Event objects belonging to the tournament
- return Promise<Event[]>
-
getPhases()
- aggregates all the Phase objects belonging to the tournament
- return Promise<Phase[]>
-
getPhaseGroups()
- aggregates all the PhaseGroup objects belonging to the tournament
- return Promise<PhaseGroup[]>