Record Class DoubleOpportunityContext

java.lang.Object
java.lang.Record
com.fortemate.dicechess.runtime.DoubleOpportunityContext
Record Components:
gameId - the game's id
seat - the bot's seat, exactly White or Black
version - the authoritative game-state version carried by the delivery
dfen - the pre-roll position; no dice are present
clock - the game clock, or null for an untimed game
doubling - the complete doubling state and pending offer decision
All Implemented Interfaces:
DoublingContext

public record DoubleOpportunityContext(String gameId, String seat, long version, String dfen, GameClock clock, DoublingState doubling) extends Record implements DoublingContext
Authenticated pre-roll context for deciding whether to offer a stake double on this bot's turn.

This context is structurally dice-free: the platform presents the doubling opportunity before deriving or revealing any dice.

  • Constructor Details

    • DoubleOpportunityContext

      public DoubleOpportunityContext(String gameId, String seat, long version, String dfen, GameClock clock, DoublingState doubling)
      Creates a validated double-opportunity context.
  • Method Details

    • decision

      public DoublingDecision.Offer decision()
      Description copied from interface: DoublingContext
      Returns the typed doubling decision.
      Specified by:
      decision in interface DoublingContext
      Returns:
      the doubling decision
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components 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.
    • gameId

      public String gameId()
      Returns the value of the gameId record component.
      Specified by:
      gameId in interface DoublingContext
      Returns:
      the value of the gameId record component
    • seat

      public String seat()
      Returns the value of the seat record component.
      Specified by:
      seat in interface DoublingContext
      Returns:
      the value of the seat record component
    • version

      public long version()
      Returns the value of the version record component.
      Specified by:
      version in interface DoublingContext
      Returns:
      the value of the version record component
    • dfen

      public String dfen()
      Returns the value of the dfen record component.
      Specified by:
      dfen in interface DoublingContext
      Returns:
      the value of the dfen record component
    • clock

      public GameClock clock()
      Returns the value of the clock record component.
      Specified by:
      clock in interface DoublingContext
      Returns:
      the value of the clock record component
    • doubling

      public DoublingState doubling()
      Returns the value of the doubling record component.
      Specified by:
      doubling in interface DoublingContext
      Returns:
      the value of the doubling record component