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

    Class Game

    A WASM-friendly wrapper around the core Game type.

    This class holds the accumulated game log (drives and plays) and provides query methods for accessing enriched play data, stats, and serialization.

    Index

    Constructors

    • Creates a new empty game.

      Returns Game

    Properties

    complete: boolean

    Returns true if the game is complete.

    driveCount: number

    Returns the number of drives in the game so far.

    playCount: number

    Returns the total number of plays in the game so far.

    Methods

    • Returns the away team's offensive stats as a JSON object.

      Returns any

    • Returns void

    • Returns a specific drive by index with enriched play data.

      Arguments

      • index - The drive index (0-based)

      Parameters

      • index: number

      Returns Drive

    • Returns the latest play with enriched data, or null if no plays have been simulated.

      Returns Play

    • Returns the home team's offensive stats as a JSON object.

      Returns any

    • Returns the game as a JSON-serializable object.

      The structure matches the core Game type used in league matchups.

      Returns any