Lays out an elimination bracket for the bracket scene: of double elimination the sides in focus, compactified to the rounds still being played unless the whole bracket is in focus. The featured match is shown as far as the view shows it, so a result not on air yet doesn't spoil it, neither does its winner advancing in the bracket.
exportfunctionlayout({
idx,
name,
type,
data,
groupId,
focus,
featured,
teamById,
}: {
idx: number;
name: string;
type: "single_elimination" | "double_elimination";
data: BracketData;
/** Group shown of a bracket split into groups. */
groupId: number | undefined;
focus: BroadcastBracketFocus;
featured: FeaturedMatch | null;
teamById: (id: number) => BroadcastBracketTeam | null;
}): BroadcastEliminationBracket
Index of the bracket the bracket scene shows: the producer's pick, the featured match's bracket or else the last one, of the brackets it can show. null when there is none.
exportfunctionresolveBracketIdx({
pickedIdx,
featuredMatchBracketIdx,
showableIdxs,
}: {
pickedIdx: number | null;
featuredMatchBracketIdx: number | null;
/** See {@link showableBracketIdxs}. */
showableIdxs: number[];
})
The bracket with the featured match at the view's progress. While the view has its set going, its teams are taken out of the elimination matches they advanced to.
Builds the state the channel's cast overlays render from fresh (uncached) data, along with the event channels whose events change it. null when the tournament has no cast channel by the slug.
exporttypeKey =
| {
type: "scene";
scene: CastScene;
/** The scene on air. */
isLive: boolean;
/** The scene of the queue item the dashboard edits, the one pressing a scene key changes. */
isSelected: boolean;
isDisabled: boolean;
}
| {
type: "queueItem";
/** Of the queue item edited, 0 for next. */
position: number;
/** Items in the queue. */
count: number;
scene: CastScene;
/** The item pressing the key edits instead, the first again after the last. `null` while next is the only item: pressing it queues a new one. */
nextItemId: number | null;
isDisabled: false;
}
| {
type: "advance";
/** The queue item edited. */
itemId: number;
/** How it goes on air besides a Take. */
advance: BroadcastAdvance;
/** Which game event `game` waits for, `null` for the other advances. */
gameCue: "start" | "end" | null;
/** What pressing the key sets it to, the next of the advances it can have. */
nextAdvance: BroadcastAdvance;
/** Only a Take can put it on air. */
isDisabled: boolean;
}
| {
type: "take";
isDisabled: boolean;
/** Time until next goes on air by itself, `null` when it doesn't by a timer. */
remainingMs: number | null;
/** Next goes on air as the scanner sees this, `null` when it doesn't wait for a game. */
gameCue: "start" | "end" | null;
/** Next goes on air by itself in a moment. */
isImminent: boolean;
};
What each key of a 15 key Stream Deck shows, from the top left row by row ({@link StreamDeck.COLUMNS} per row). A scene key sets the scene of selected (the queue item the dashboard edits, as the number keys do). The queue item key moves the editing on to the next item in the queue (queues a new one while next is the only item), the advance key cycles how the item edited goes on air (on a Take, by a timer, at a game start or end) through the ones it can have there, and Take does what the dashboard's button does. Keys that can't do anything right now are disabled, e.g. the match scenes while no match is cast.
exportfunctionkeys({
state,
selected,
now,
}: {
state: CastBroadcastState;
selected: CastProducerState;
/** Server time, `null` before the clock is synced. */
now: number | null;
}): Key[]
A broadcast's whole state made up for the designer: the scene on air in the scenario's situation, with mock teams, players, casters, brackets and other matches.
exportfunctionbuild({
scenario,
tournament: realTournament,
settings,
takenAt,
}: {
scenario: Scenario;
/** The real tournament, the In The Zone logo standing in for its own if it has none (an empty `logoUrl`). */
tournament: CastBroadcastState["tournament"];
settings: CastBroadcastSettings;
/** When the scene went on air, what starting soon counts down from. */
takenAt: number;
}): CastBroadcastState
The game the results scene shows in the view: the featured match's last game the scanner read (scannedGame), whichever of the set's games it was, else the last one reported with the teams' rosters. A scanned game is the set's game with its map and mode, the one played last when several have them. Its teams are put in bracket order by the game's ink colors (the pair's first color going to the team the producer gave it, see BroadcastInk.isFlipped), else by the names read matching the rosters. Names not read are filled in from the roster players no read name matched. Its winner is the scanner's, from a results screen or the counter, else the reported one of the set's game it was. null when the match has no game to show.
Lays out a round robin group for the bracket scene: its standings and rounds. A big group's are cut to the standings around the featured match's teams and the rounds around the one being played.
Lays out a Swiss group for the bracket scene: its standings, of a big group the ones around the featured match's teams, and the round being played with its matches pooled by the record their teams went into it with.
The team's tournament so far for the team scene: its sets in the order it played them up to the one being played (or the next one once its opponent or round is known), its record and how it did per mode. The featured match is shown as far as the view shows it, so a result not on air yet doesn't spoil it, neither does its winner advancing.
exportfunctionbuild({
teamId,
brackets,
games,
featured,
teamById,
roundLabelOf,
}: {
teamId: number;
/** The tournament's started brackets in the order they were played. */
brackets: Array<{ data: BracketData }>;
/** Reported games of the team's sets, in playing order. */
games: GameResult[];
featured: BracketFocus.FeaturedMatch | null;
teamById: (id: number) => BroadcastBracketTeam | null;
roundLabelOf: (matchId: number) => string;
}): Pick<BroadcastTeamSpotlight, "sets" | "record" | "modes">