InsanichessChallenge class Null safety
Represents an issued challenge for a game.
Constructors
- InsanichessChallenge({required InsanichessPlayer? createdBy, required InsanichessTimeControl timeControl, required PieceColor? preferColor, required bool isPrivate, required ChallengeStatus status})
-
Creates new
InsanichessChallenge
object with timeControl, challenger's preferColor selection, and whether this game isPrivate or not.const -
InsanichessChallenge.fromJson(Map<
String, dynamic> json) -
Creates new
InsanichessChallenge
fromjson
.
Properties
- createdBy → InsanichessPlayer?
-
The player's username who created this challenge.
final
- hashCode → int
-
The hash code for this object.
read-onlyinherited
- isPrivate → bool
-
Whether the challenge is private.
final
- preferColor → PieceColor?
-
Challenger's color preference or null.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
- status → ChallengeStatus
-
Current status of the challenge.
final
- timeControl → InsanichessTimeControl
-
Time control for the game.
final
Methods
-
addCreatedBy(
InsanichessPlayer player) → InsanichessChallenge -
Copies the object and sets createdBy to
player
. It throwsUnsupportedError
in case this object already has non-empty createdBy field value. -
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
-
updateStatus(
ChallengeStatus status) → InsanichessChallenge -
Copies the object with new
status
.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited