fbsim-core JavaScript & TypeScript API - v1.0.0-beta.2
    Preparing search index...

    Class LeagueSeason

    A WASM-friendly wrapper around LeagueSeason.

    Index

    Constructors

    • Creates a new empty season (defaults to the current year).

      Returns LeagueSeason

    Properties

    complete: boolean

    Returns true if the entire season (including playoffs) is complete.

    conferences: any

    Returns the conferences as a JSON array.

    playoffs: any

    Returns the playoffs as a JSON object.

    regularSeasonComplete: boolean

    Returns true if the regular season is complete.

    standings: any

    Returns the overall standings as a JSON array of [teamId, record] pairs.

    started: boolean

    Returns true if the season has started (any game played).

    teams: any

    Returns the teams as a JSON object (BTreeMap<usize, FootballTeam>).

    weeks: any

    Returns the season weeks as a JSON array.

    year: number

    Gets the season year.

    Methods

    • Adds a conference to the season (takes ownership).

      Parameters

      Returns void

    • Adds a team to the season.

      Parameters

      Returns void

    • Returns a team's conference record as a JSON object.

      Parameters

      • team_id: number

      Returns any

    • Returns the standings for a specific conference as a JSON array.

      Parameters

      • conf_index: number

      Returns any

    • Returns a team's division record as a JSON object.

      Parameters

      • team_id: number

      Returns any

    • Returns the standings for a specific division as a JSON array.

      Parameters

      • conf_index: number
      • div_id: number

      Returns any

    • Returns void

    • Generates the next playoff round (used for multi-round brackets).

      Parameters

      Returns void

    • Generates the regular season schedule.

      options is a plain JS object matching LeagueSeasonScheduleOptions (e.g. { division_games: 2, permute: true }).

      Parameters

      Returns void

    • Returns the playoff picture as a JSON object.

      Parameters

      • num_teams: number

      Returns any

    • Returns a team's playoff record as a JSON object.

      Parameters

      • team_id: number

      Returns any

    • Simulates the entire season (regular season + playoffs if generated).

      Parameters

      Returns void

    • Simulates a single matchup to completion. Returns the game log as JSON.

      Parameters

      • week: number
      • matchup: number
      • rng: Rng

      Returns any

    • Simulates a single play of a matchup. Returns the game log as JSON if the game finished on this play, or undefined if still in progress.

      Parameters

      • week: number
      • matchup: number
      • rng: Rng

      Returns any

    • Simulates a full round in a single conference bracket.

      Parameters

      • conference: number
      • round: number
      • rng: Rng

      Returns void

    • Simulates a single playoff matchup to completion. Returns game log as JSON.

      Parameters

      • conference: number
      • round: number
      • matchup: number
      • rng: Rng

      Returns any

    • Simulates a single play of a playoff matchup. Returns game log as JSON if the game finished, or undefined if still in progress.

      Parameters

      • conference: number
      • round: number
      • matchup: number
      • rng: Rng

      Returns any

    • Simulates a full playoff round across all conference brackets.

      Parameters

      • round: number
      • rng: Rng

      Returns void

    • Simulates all remaining playoffs.

      Parameters

      Returns void

    • Simulates all remaining regular season weeks.

      Parameters

      Returns void

    • Simulates all matchups in a single week.

      Parameters

      • week: number
      • rng: Rng

      Returns void

    • Simulates a single winners bracket matchup to completion. Returns game log as JSON.

      Parameters

      • round: number
      • matchup: number
      • rng: Rng

      Returns any

    • Simulates a single play of a winners bracket matchup. Returns game log as JSON if the game finished, or undefined if still in progress.

      Parameters

      • round: number
      • matchup: number
      • rng: Rng

      Returns any

    • Simulates a full round of the winners bracket.

      Parameters

      • round: number
      • rng: Rng

      Returns void

    • Checks if a team exists in the season.

      Parameters

      • id: number

      Returns boolean

    • Returns true if a team made it to the championship.

      Parameters

      • team_id: number

      Returns boolean

    • Returns true if a team participated in the playoffs.

      Parameters

      • team_id: number

      Returns boolean

    • Returns all matchups involving a team as a JSON object.

      Parameters

      • id: number

      Returns any

    • Returns true if a team won the championship.

      Parameters

      • team_id: number

      Returns boolean

    • Returns the season as a JSON-serializable object.

      Returns any