Record Class DoubleOpportunityContext
java.lang.Object
java.lang.Record
com.fortemate.dicechess.runtime.DoubleOpportunityContext
- Record Components:
gameId- the game's idseat- the bot's seat, exactlyWhiteorBlackversion- the authoritative game-state version carried by the deliverydfen- the pre-roll position; no dice are presentclock- the game clock, ornullfor an untimed gamedoubling- 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 Summary
ConstructorsConstructorDescriptionDoubleOpportunityContext(String gameId, String seat, long version, String dfen, GameClock clock, DoublingState doubling) Creates a validated double-opportunity context. -
Method Summary
Modifier and TypeMethodDescriptionclock()Returns the value of theclockrecord component.decision()Returns the typed doubling decision.dfen()Returns the value of thedfenrecord component.doubling()Returns the value of thedoublingrecord component.final booleanIndicates whether some other object is "equal to" this one.gameId()Returns the value of thegameIdrecord component.final inthashCode()Returns a hash code value for this object.seat()Returns the value of theseatrecord component.final StringtoString()Returns a string representation of this record class.longversion()Returns the value of theversionrecord component.Methods inherited from interface DoublingContext
cubeOwner, cubeValue, currency, currentStake, decisionId, initialStake, maximumMultiplier, mayOfferDouble, proposedStake, turnSeat
-
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
Description copied from interface:DoublingContextReturns the typed doubling decision.- Specified by:
decisionin interfaceDoublingContext- Returns:
- the doubling decision
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
gameId
Returns the value of thegameIdrecord component.- Specified by:
gameIdin interfaceDoublingContext- Returns:
- the value of the
gameIdrecord component
-
seat
Returns the value of theseatrecord component.- Specified by:
seatin interfaceDoublingContext- Returns:
- the value of the
seatrecord component
-
version
public long version()Returns the value of theversionrecord component.- Specified by:
versionin interfaceDoublingContext- Returns:
- the value of the
versionrecord component
-
dfen
Returns the value of thedfenrecord component.- Specified by:
dfenin interfaceDoublingContext- Returns:
- the value of the
dfenrecord component
-
clock
Returns the value of theclockrecord component.- Specified by:
clockin interfaceDoublingContext- Returns:
- the value of the
clockrecord component
-
doubling
Returns the value of thedoublingrecord component.- Specified by:
doublingin interfaceDoublingContext- Returns:
- the value of the
doublingrecord component
-