matchupsFromGames関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Matchups from a flat list of games: the games of one pair in one stage become one tie (a replay, two legs or a series), the stage orders the rounds, and the third-place stage becomes the third-place match. The sides of a tie are the home and away of its first game; each game's score is turned to that order.
インポート
import { matchupsFromGames } from "@johnmorrisdotca/taisen-brackets/layout";
ほかのエクスポート元: @johnmorrisdotca/taisen-brackets
定義
function matchupsFromGames(games: readonly PlayedGame[], options: GamesOptions): Matchup[]
引数
| 名前 | 型 | 説明 |
|---|---|---|
games | readonly PlayedGame[] | The games, in any order. |
options | GamesOptions | The stages in order, and which are the third-place match, two-legged ties or series. |
戻り値
Matchup[]
The matchups, ready for layoutBracket and drawBracket.
例
import { drawBracket, matchupsFromGames } from "@johnmorrisdotca/taisen-brackets";
const games = [
{ stage: "Semi-final", home: "Aurora", away: "Harbour", homeScore: 2, awayScore: 1 },
{ stage: "Semi-final", home: "Cascade", away: "Delta", homeScore: 0, awayScore: 1 },
{ stage: "Final", home: "Aurora", away: "Delta", homeScore: 3, awayScore: 1 },
];
console.log(drawBracket(matchupsFromGames(games, { stages: ["Semi-final", "Final"] })).startsWith("<svg"));true出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。