Returns a player in a PlayerGroup
index in the player group (starting from 0) or undefined
Get the polygon shape of the zone behind players of a specific role. NOTE: if you call this method directly you will get the ABSOLUTE position of the players in the group, not the position normalized with the event team attacking to the right. If you want to get the normalized position you should use:
event.position.teammatesBehindZone(playersRole)
or
event.position.opponentsBehindZone(playersRole)
role of the players to consider (e.g., 'Defender').
wether the team is playing left to rigth (LTR) or not.
the polygon shape of the zone behind the players as a Zone object.
Get the depth of a PlayerGroup.
DEPTH is the horizontal distance between the front-most and back-most player.
the sport for which the definition is applied.
the distance in meters or 0 if not available.
Returns the first player of the group matching the given condition
function that has the player as argument and returns true if the player matches the desired condition.
a PitchPlayer or null if no player of the group matches the given condition.
Get a player, with tracking coords and speed, from a given group, undefined if the player is not in that group.
a player to search inside the group
the player object enriched with tracking data or undefined
Check if a player group include a given player.
a player to search inside the group
the index of the player in the group or undefined if not
Returns a group of player from the given group that is located in the specified field zone. NOTE: if you call this method directly you will get the ABSOLUTE position of the players in the group, not the position normalized with the event team attacking to the right.
If you want to get the normalized position you should use:
event.position.teammatesIn(zone)
or
event.position.opponentsIn(zone)
the zone where the players are located
a group of player (may be empty)
Remove from a group a given player (if it is in the group)
the player to remove from the group
Get the polygon shape of a PlayerGroup (excluding Goalkeeper). NOTE: if you call this method directly you will get the ABSOLUTE position of the players in the group, not the position normalized with the event team attacking to the right. If you want to get the normalized position you should use:
event.position.teammatesShape(playersToInclude)
or
event.position.opponentsShape(playersToInclude)
players to use as the vertices of the polygon, wheter all the players or only the external ones (Convex Hull).
the polygon shape of the PlayerGroup as a Zone.
Get the width of a PlayerGroup.
Width is the vertical distance between the left-most and right-most player on a player group
the sport for which the definition is applied.
the distance in meters or 0 if not available.
Returns a group of player from the given group that is distant from a point less than "distance" meters
x position of the point to measure the distance (in % of the field length)
y position of the point to measure the distance (in % of the field width)
max distance in meters
a group of player (may be empty)
Returns a group of player from the given group that is distant from a player less than "distance" meters
the player from which to check the distance
max distance in meters
a group of player (may be empty)
This class implements the logic to handle a group of player.
NOTE: the position of the players in a player group is always the absolute position of the players in the field, it's not normalized with the "event" team attacking left to right.
This is not possible since a player group can contain also players from both teams.
If you want to handle tracking coordinates normalized so that the event team plays left to right you should use the position manager methods (ie currentEvent.position.opponentsIn(zone) ...)