InsanichessChallenge class

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 from json.

Properties

createdBy InsanichessPlayer?
The player's username who created this challenge.
final
hashCode int
The hash code for this object.
no setterinherited
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.
no setterinherited
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 throws UnsupportedError in case this object already has non-empty createdBy field value.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent 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