InsanichessGameEvent class Null safety
Base class for game events.
Game events are streamed and received on sockets.
The type indicates the type of this game event for efficient parsing from json by either client or server applications.
The isBroadcasted property indicates whether this event should be sent to broadcast stream or not. This property is always set by the server, therefore clients do not need to set it. If they do, it will be ignored by the server.
Constructors
- InsanichessGameEvent(GameEventType type, {bool isBroadcasted = false})
-
Provides const constructor for implementers.
const
-
InsanichessGameEvent.fromJson(Map<
String, dynamic> json) -
Creates a concrete implementer of
InsanichessGameEvent
based on the type provided in json.factory
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.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
- type → GameEventType
-
The type of this event. This is used to efficiently parse the game event
data from received json.
final
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.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited