Record Class DrawAction
java.lang.Object
java.lang.Record
com.fortemate.dicechess.runtime.DrawAction
- Record Components:
acceptDraw-trueto accept the pending draw offer,falseto decline itisResign-trueto resign the game
A bot's response to a
drawDecision delivery.-
Constructor Summary
ConstructorsConstructorDescriptionDrawAction(boolean acceptDraw) Creates a draw action.DrawAction(boolean acceptDraw, boolean isResign) Creates an instance of aDrawActionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic DrawActionaccept()Returns an action that accepts the pending draw offer.booleanReturns the value of theacceptDrawrecord component.static DrawActiondecline()Returns an action that explicitly declines the pending draw offer.final 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.static DrawActionresign()Returns an action that resigns the game.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
DrawAction
public DrawAction(boolean acceptDraw) Creates a draw action.- Parameters:
acceptDraw-trueto accept the pending draw offer,falseto decline it
-
DrawAction
public DrawAction(boolean acceptDraw, boolean isResign) Creates an instance of aDrawActionrecord class.- Parameters:
acceptDraw- the value for theacceptDrawrecord componentisResign- the value for theisResignrecord component
-
-
Method Details
-
accept
Returns an action that accepts the pending draw offer.- Returns:
- an accepting action
-
decline
Returns an action that explicitly declines the pending draw offer.- Returns:
- a declining action
-
resign
Returns an action that resigns the game.- Returns:
- a resigning 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. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
acceptDraw
public boolean acceptDraw()Returns the value of theacceptDrawrecord component.- Returns:
- the value of the
acceptDrawrecord component
-
isResign
-