Me

Represents the local player in the game.

Constructor

new Me()

This class holds the state of the local player, including their ID, team information, position, score, and penalty. It provides a method to update the player's state based on server payload and time. * @property {string|null} id - The unique identifier of the player.
Properties
NameTypeDescription
teamIdstring | nullThe ID of the team the player belongs to.
teamNamestring | nullThe name of the team the player belongs to.
namestring | nullThe name of the player.
xnumber | nullThe x-coordinate of the player's position.
ynumber | nullThe y-coordinate of the player's position.
scorenumber | nullThe current score of the player.
penaltynumber | nullThe current penalty of the player.
msnumber | nullThe timestamp in milliseconds when the player's state was last updated.
framenumber | nullThe frame number when the player's state was last updated.

Classes

Me

Methods

update(payload, time)

This method updates the player's ID, name, team information, position, score, and penalty, as well as the timestamp and frame number for the current state.
Parameters:
NameTypeDescription
payloadObjectThe data received from the server containing player information.
timeObjectAn object containing the current time in milliseconds and frame number.