Options
All
  • Public
  • Public/Protected
  • All
Menu

A player object

Hierarchy

  • Player

Implements

  • IPlayer

Index

Constructors

  • new Player(id: string): Player
  • Parameters

    • id: string

    Returns Player

Properties

captain: boolean = false

True if the player is the captain at the start of the game.

firstName: string

First name of the player.

id: string

ID of the player as defined by the data provider.

lastName: string

Last (family) name of the player.

role: string

Role of the player

shirtNumber: string

Shirt number that the player used in one of the games object of the analysis, may be undefined if he has not played

substitute: boolean = false

True if the player was a substitute at the start of the game.

team: Team

Team of the player

Accessors

  • Handle the position of the opponents of the given player.

    Returns PlayerGroup

  • Handle the position of the player and his teammates/opponents, available only when we have tracking data.

    Returns PlayerPositionManager

  • Handle the position of the teammates of the given player.

    Returns PlayerGroup

Methods

  • addAttribute(name: string, value?: string): void
  • Add an attribute to the player, this attribute will persist on the player until the end of the game, starting from the current event timestamp.

    Parameters

    • name: string

      name of the attribute

    • Optional value: string

      value of the attribute

    Returns void

  • getAttribute(name: string): string
  • Get the value a player specific attribute, returns undefined if the attribute is not available for the given player in the current match or it's available from a timestamp greater than the one in the current event.

    Parameters

    • name: string

      name of the attribute

    Returns string

    an attribute value or undefined

  • hasAttribute(name: string): boolean
  • Check if the given player has a particular attribute active, returns false if the attribute is not available for the given player in the current match or it's available from a time greater than the one in the current event.

    Parameters

    • name: string

      name of the attribute

    Returns boolean

    true if a player attribute is available for the given player.

  • is(player: string | IPlayer): boolean
  • Returns if the player is the one in the paramater.

    Parameters

    • player: string | IPlayer

      the name, the id or the player object itself

    Returns boolean

  • resetAttribute(name: string): boolean
  • Reset the given attribute of the player from the timestamp of the current event. The attribute will not be available anymore on the player from that timestamp and on next events.

    Parameters

    • name: string

      name of the attribute

    Returns boolean

    true if the attribute was available for the given player