Record Class TurnAction
java.lang.Object
java.lang.Record
com.fortemate.dicechess.runtime.TurnAction
- Record Components:
moves- the complete sequence of UCI micro-moves; an empty list plays nothing and is not a forced-pass commandofferDraw- whether to offer a draw together with the completed turnisResign- whether to resign the game
-
Constructor Summary
ConstructorsConstructorDescriptionTurnAction(List<String> moves) Creates a turn action that does not offer a draw and does not resign.TurnAction(List<String> moves, boolean offerDraw) Creates a turn action that does not resign.TurnAction(List<String> moves, boolean offerDraw, boolean isResign) Creates an immutable turn action. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisResign()Returns the value of theisResignrecord component.moves()Returns the value of themovesrecord component.booleanReturns the value of theofferDrawrecord component.static TurnActionresign()Returns a turn action that resigns the game.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
TurnAction
Creates an immutable turn action.- Throws:
NullPointerException- ifmovesor one of its elements isnull
-
TurnAction
-
TurnAction
-
-
Method Details
-
resign
Returns a turn action that resigns the game.- Returns:
- a resigning turn action
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
moves
-
offerDraw
-
isResign
-