Record Class DoubleOfferAction

java.lang.Object
java.lang.Record
com.fortemate.dicechess.runtime.DoubleOfferAction
Record Components:
offerDouble - true to offer a stake double, false to proceed to roll
isResign - true to resign the game

public record DoubleOfferAction(boolean offerDouble, boolean isResign) extends Record
A bot's response to a doubleOpportunity delivery.
  • Constructor Details

    • DoubleOfferAction

      public DoubleOfferAction(boolean offerDouble)
      Creates a double offer action.
      Parameters:
      offerDouble - true to offer a stake double, false to proceed to roll
    • DoubleOfferAction

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

    • offer

      public static DoubleOfferAction offer()
      Returns an action that offers a stake double.
      Returns:
      an offering action
    • roll

      public static DoubleOfferAction roll()
      Returns an action that declines to double and proceeds to roll.
      Returns:
      a rolling action
    • decline

      public static DoubleOfferAction decline()
      Synonym for roll(): declines to offer a double and proceeds to roll.
      Returns:
      a rolling action
    • resign

      public static DoubleOfferAction 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.
    • offerDouble

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

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