new Telegram(sender, receiver, message, delay, data)
Constructs a new telegram object.
Parameters:
Name | Type | Description |
---|---|---|
sender |
GameEntity | The sender. |
receiver |
GameEntity | The receiver. |
message |
String | The actual message. |
delay |
Number | A time value in millisecond used to delay the message dispatching. |
data |
Object | An object for custom data. |
Members
-
data :Object
-
An object for custom data.
-
delay :Number
-
A time value in millisecond used to delay the message dispatching.
-
message :String
-
The actual message.
-
receiver :GameEntity
-
The receiver.
-
sender :GameEntity
-
The sender.
Methods
-
fromJSON(json) → {Telegram}
-
Restores this instance from the given JSON object.
Parameters:
Name Type Description json
Object The JSON object.
-
resolveReferences(entities) → {Telegram}
-
Restores UUIDs with references to GameEntity objects.
Parameters:
Name Type Description entities
Map.<String, GameEntity> Maps game entities to UUIDs.
-
toJSON() → {Object}
-
Transforms this instance into a JSON object.
Returns:
Object -The JSON object.