Record Class DoubleResponseAction

java.lang.Object
java.lang.Record
com.fortemate.dicechess.runtime.DoubleResponseAction
Record Components:
acceptDouble - true to accept the pending double offer, false to decline it
isResign - true to resign the game

public record DoubleResponseAction(boolean acceptDouble, boolean isResign) extends Record
A bot's response to a doubleDecision delivery.
  • Constructor Details

    • DoubleResponseAction

      public DoubleResponseAction(boolean acceptDouble)
      Creates a double response action.
      Parameters:
      acceptDouble - true to accept the pending double offer, false to decline it
    • DoubleResponseAction

      public DoubleResponseAction(boolean acceptDouble, boolean isResign)
      Creates an instance of a DoubleResponseAction record class.
      Parameters:
      acceptDouble - the value for the acceptDouble record component
      isResign - the value for the isResign record component
  • Method Details

    • accept

      public static DoubleResponseAction accept()
      Returns an action that accepts the pending double offer.
      Returns:
      an accepting action
    • decline

      public static DoubleResponseAction decline()
      Returns an action that explicitly declines the pending double offer.
      Returns:
      a declining action
    • drop

      public static DoubleResponseAction drop()
      Synonym for decline(): drops the double and forfeits at the current stake.
      Returns:
      a declining action
    • resign

      public static DoubleResponseAction resign()
      Returns an action that resigns the game.
      Returns:
      a resigning action
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • acceptDouble

      public boolean acceptDouble()
      Returns the value of the acceptDouble record component.
      Returns:
      the value of the acceptDouble record component
    • isResign

      @SerializedName("resign") public boolean isResign()
      Returns the value of the isResign record component.
      Returns:
      the value of the isResign record component