Record Class TurnContext

java.lang.Object
java.lang.Record
com.fortemate.dicechess.runtime.TurnContext
Record Components:
gameId - the game's id, suitable for strategy-owned per-game state
seat - the bot's seat, exactly White or Black
version - the authoritative game-state version carried by the delivery
dfen - the position plus the rolled dice for the side to move
clock - the game clock, or null for an untimed game
legalMoves - every complete legal turn, each as its sequence of UCI micro-moves. An empty list means the server is auto-passing, so no bot action is required; null means the moves are unknown because the inline tree was absent/capped and no fallback result was available
mayOfferDraw - whether the platform currently permits this side to offer a draw; absent, null, or malformed wire values fail closed to false

public record TurnContext(String gameId, String seat, long version, String dfen, GameClock clock, List<List<String>> legalMoves, boolean mayOfferDraw) extends Record
Authenticated context for the turn a bot must play.
  • Constructor Details

    • TurnContext

      public TurnContext(String gameId, String seat, long version, String dfen, GameClock clock, List<List<String>> legalMoves, boolean mayOfferDraw)
      Creates a validated context with an immutable deep copy of the legal-move paths.
  • Method Details

    • 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.
      Returns:
      the value of the gameId record component
    • seat

      public String seat()
      Returns the value of the seat record component.
      Returns:
      the value of the seat record component
    • version

      public long version()
      Returns the value of the version record component.
      Returns:
      the value of the version record component
    • dfen

      public String dfen()
      Returns the value of the dfen record component.
      Returns:
      the value of the dfen record component
    • clock

      public GameClock clock()
      Returns the value of the clock record component.
      Returns:
      the value of the clock record component
    • legalMoves

      public List<List<String>> legalMoves()
      Returns the value of the legalMoves record component.
      Returns:
      the value of the legalMoves record component
    • mayOfferDraw

      public boolean mayOfferDraw()
      Returns the value of the mayOfferDraw record component.
      Returns:
      the value of the mayOfferDraw record component