Options
All
  • Public
  • Public/Protected
  • All
Menu

The current game

Hierarchy

  • Game

Index

Constructors

Properties

awayTeamId: string

ID of the away team, may be useful in rules.

competition: string

The competition in which this game has been played

currentEvent: Event = null

Current event that is being processed by the parser, point to the last event in the sequence in "sequence" type rules.

currentSequence: Sequence = null

Current sequence that is being processed by the parser, unavailable for "event" type rules.

customEvents: Event[]

All the customEvents in the given match.

customSequences: Sequence[]

All the customEvents in the given match.

events: Event[]

All the events in the given match.

excludedPlayers: string[]

A list of player that should be excluded from formation calculation since they are not active part of the game (for instance the football goalkeepers)

gameStates: GameState[] = []

The raw tracking states, can be used only in tracking rules.

homeTeamId: string

ID of the home team, may be useful in rules.

id: string

id of the match (depends from the source data)

periods: Period[]

Periods and period lengths available for the given sport

players: Player[]

Players that took part in the match

previousEvent: Event = null

The event processed just before the current one by the parser, not available in sequence rules or if analyzing the first event.

previousSequence: Sequence = null

The previous sequence processed just before the current, unavalable for "event" type rules or if analyzing the first sequence.

result: string

Final result of the game in the format of X:Y where X is the number of points for the home team

rules: Rule[]

List of rules applied to this match

scheduledDate: Date

Scheduled match start, may be different from the first match event

sequences: Sequence[]

Sequences created for this game.

source: Source

Source used to generate this match

teams: Team[]

Teams that took part in the match

trackingFormat: Source

The tracking format associated to this game, may be null if only events are available

Accessors

  • get awayTeam(): Team
  • Get the away team

    Returns Team

  • get homeTeam(): Team
  • Get the home team

    Returns Team

  • get title(): string
  • The title of the game, for instance Genoa - Milan

    Returns string

Methods

  • Create a new custom event using as input a CustomEventOptions object. The object can be customized to inherit part of the new event from the current event.

    Parameters

    Returns Event

    the new event, to be edited, if needed.

  • Create a new sequence from the current rule, using an arbitrary (optional) list of events.

    NB: if you create the custom sequence without events you will have to set up start/endTime and period by hand.

    Parameters

    • name: string

      the mandatory name of the sequence to create.

    • team: Team

      the mandatory team for the sequence

    • Optional events: Event[]

      optional list of events to attach to the sequence.

    Returns Sequence

  • getPlayerById(id: string): Player
  • Get a player by his id

    Parameters

    • id: string

      id of the player

    Returns Player

    the player with the given id

  • getTeamById(id: string): Team
  • Get a team by his id

    Parameters

    • id: string

      id of the team

    Returns Team

    the team with the given id

  • homeIsLeft(period: number): boolean
  • Returns if the home team is attacking left to right (true) or right to left (false) in the given period. This has to be used only in tracking rules, in event/sequence rules, the position of the player in the event is always normalized as if the team is attacking left to right.

    Parameters

    • period: number

      period of the match

    Returns boolean

    true if the home team is attacking left to right in the given period

  • Can be used to develop cross-sport rules, this API returns the sport type this data is for.

    At the moment it returns only FOOTBALL and UNKNOWN in the SportType enum

    Returns SportType

    the sport this data is based on.