Class: SnapshotNetworkObject2D

Grape2D. SnapshotNetworkObject2D

new SnapshotNetworkObject2D(id, posX, posY)

Represents a simplified version of a network object. To be converted to or from a snapshot.
Parameters:
Name Type Description
id number | string Object unique identifier.
posX number The x coordinate, of the position.
posY number The y coordinate, of the position.
Source:

Members

<private> id :number|string

Unique object id.
Type:
  • number | string
Source:

<private> position :Grape2D.Vector

Object's position.
Type:
Source:

Methods

getId() → {number|string}

Gets object's id.
Source:
Returns:
Object id.
Type
number | string

getPosition() → {Grape2D.Vector}

Gets object's position.
Source:
Returns:
Object position.
Type
Grape2D.Vector

updateNetworkObject2D(param)

Updates the corresponding Grape2D.NetworkObject2D, with the data of this one.
Parameters:
Name Type Argument Description
param Object <optional>
An arbitrary object.
Source: