MovePlayedGameEvent class Null safety

Event that contains data about the move that has been played.

Additionally, server sets timeSpent in order for clients to synchronise their clocks. In case these values are set by the client, they are simply ignored.

This event is always broadcasted because subscribers of the broadcast stream must know that a move has been played. This event is also sent back to the same player that sent it initially so that he can sync his clock.

Inheritance

Constructors

MovePlayedGameEvent({required Move move, Duration? timeSpent, PieceColor? player})
Creates new MovePlayedGameEvent with move and optional timeSpent for this move. The server always sets timeSpent but if client sets it, it is simply ignored by the server.
const

Properties

hashCode int
The hash code for this object.
read-onlyinherited
isBroadcasted bool
Whether this event should be broadcasted or not. Events that are not broadcasted are only sent to opponent's socket.
finalinherited
move Move
The move that wants to be played or has been played.
final
player PieceColor?
The color of the player that made the move.
final
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
timeSpent Duration?
The time the player has spent for the move.
final
type GameEventType
The type of this event. This is used to efficiently parse the game event data from received json.
finalinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toJson() Map<String, Object?>
Converts this object to json representation.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited