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

    Class FootballTeam

    A WASM-friendly wrapper around FootballTeam.

    This wrapper provides JavaScript-accessible constructors and methods for creating and manipulating football teams.

    Index

    Constructors

    • Creates a new team with default values.

      The team will have the name "Null Island Defaults" and all attributes set to 50.

      Returns FootballTeam

    Properties

    defenseOverall: number

    Gets the team's defensive overall rating.

    name: string

    Gets the team's name.

    offenseOverall: number

    Gets the team's offensive overall rating.

    short_name: string
    shortName: string

    Gets the team's short name / abbreviation.

    Methods

    • Returns void

    • Returns the team as a JSON-serializable object.

      This allows full access to all team properties from JavaScript.

      Returns any

    • Creates a team from a JSON object.

      Arguments

      • value - A JavaScript object with team properties

      Errors

      Returns an error if the object is invalid or has out-of-range values.

      Parameters

      • value: any

      Returns FootballTeam

    • Creates a new team with the specified overall ratings.

      Arguments

      • name - The team's full name (max 64 characters)
      • short_name - The team's abbreviation (max 4 characters)
      • offense_overall - Overall offensive rating (0-100)
      • defense_overall - Overall defensive rating (0-100)

      Errors

      Returns an error if any rating is out of range or names are too long.

      Parameters

      • name: string
      • short_name: string
      • offense_overall: number
      • defense_overall: number

      Returns FootballTeam