Record Class DoubleResponseAction
java.lang.Object
java.lang.Record
com.fortemate.dicechess.runtime.DoubleResponseAction
- Record Components:
acceptDouble-trueto accept the pending double offer,falseto decline itisResign-trueto resign the game
A bot's response to a
doubleDecision delivery.-
Constructor Summary
ConstructorsConstructorDescriptionDoubleResponseAction(boolean acceptDouble) Creates a double response action.DoubleResponseAction(boolean acceptDouble, boolean isResign) Creates an instance of aDoubleResponseActionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic DoubleResponseActionaccept()Returns an action that accepts the pending double offer.booleanReturns the value of theacceptDoublerecord component.static DoubleResponseActiondecline()Returns an action that explicitly declines the pending double offer.static DoubleResponseActiondrop()Synonym fordecline(): drops the double and forfeits at the current stake.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 DoubleResponseActionresign()Returns an action that resigns the game.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
DoubleResponseAction
public DoubleResponseAction(boolean acceptDouble) Creates a double response action.- Parameters:
acceptDouble-trueto accept the pending double offer,falseto decline it
-
DoubleResponseAction
public DoubleResponseAction(boolean acceptDouble, boolean isResign) Creates an instance of aDoubleResponseActionrecord class.- Parameters:
acceptDouble- the value for theacceptDoublerecord componentisResign- the value for theisResignrecord component
-
-
Method Details
-
accept
Returns an action that accepts the pending double offer.- Returns:
- an accepting action
-
decline
Returns an action that explicitly declines the pending double offer.- Returns:
- a declining action
-
drop
Synonym fordecline(): drops the double and forfeits at the current stake.- 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. -
acceptDouble
public boolean acceptDouble()Returns the value of theacceptDoublerecord component.- Returns:
- the value of the
acceptDoublerecord component
-
isResign
-