Record Class DoublingState
java.lang.Object
java.lang.Record
com.fortemate.dicechess.runtime.DoublingState
- Record Components:
currency- the stake currency, exactlyPLAY_CREDITinitialStake- the initial stake in whole currency unitscurrentStake- the current active stake in whole currency unitscubeValue- the doubling cube multiplier (1, 2, 4, 8, 16, 32, 64)cubeOwner- the seat owning the cube, ornullif centeredmaximumMultiplier- the configured maximum multiplier cap (2, 4, 8, 16, 32, 64)mayOfferDouble- whether the current decision actor is eligible to offer a doubleturnSeat- the seat whose turn it is (survives out-of-turn response phase)decision- the pending doubling decision, ornullif no decision is pending
public record DoublingState(String currency, long initialStake, long currentStake, int cubeValue, String cubeOwner, int maximumMultiplier, boolean mayOfferDouble, String turnSeat, DoublingDecision decision)
extends Record
The doubling state of a staked game.
A centered cube (cubeValue == 1) is unowned (cubeOwner == null); a doubled
cube is owned by the seat that last accepted a double.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe required currency name for staked games.Permitted doubling cube values.Permitted maximum multiplier caps. -
Constructor Summary
ConstructorsConstructorDescriptionDoublingState(String currency, long initialStake, long currentStake, int cubeValue, String cubeOwner, int maximumMultiplier, boolean mayOfferDouble, String turnSeat, DoublingDecision decision) Creates a validated doubling state. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecubeOwnerrecord component.intReturns the value of thecubeValuerecord component.currency()Returns the value of thecurrencyrecord component.longReturns the value of thecurrentStakerecord component.decision()Returns the value of thedecisionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.longReturns the value of theinitialStakerecord component.intReturns the value of themaximumMultiplierrecord component.booleanReturns the value of themayOfferDoublerecord component.final StringtoString()Returns a string representation of this record class.turnSeat()Returns the value of theturnSeatrecord component.
-
Field Details
-
VALID_CUBE_VALUES
-
VALID_MULTIPLIERS
-
CURRENCY_PLAY_CREDIT
The required currency name for staked games.- See Also:
-
-
Constructor Details
-
DoublingState
public DoublingState(String currency, long initialStake, long currentStake, int cubeValue, String cubeOwner, int maximumMultiplier, boolean mayOfferDouble, String turnSeat, DoublingDecision decision) Creates a validated doubling state.
-
-
Method Details
-
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. -
currency
-
initialStake
public long initialStake()Returns the value of theinitialStakerecord component.- Returns:
- the value of the
initialStakerecord component
-
currentStake
public long currentStake()Returns the value of thecurrentStakerecord component.- Returns:
- the value of the
currentStakerecord component
-
cubeValue
-
cubeOwner
-
maximumMultiplier
public int maximumMultiplier()Returns the value of themaximumMultiplierrecord component.- Returns:
- the value of the
maximumMultiplierrecord component
-
mayOfferDouble
public boolean mayOfferDouble()Returns the value of themayOfferDoublerecord component.- Returns:
- the value of the
mayOfferDoublerecord component
-
turnSeat
-
decision
-