Record Class StrategicTurningPoint.ImmediateLossPrevention
java.lang.Object
java.lang.Record
org.xxdc.oss.example.analysis.StrategicTurningPoint.ImmediateLossPrevention
- Record Components:
playerMarker- the player marker for the player who made the strategic movegameState- the game state at the strategic turning pointmoveNumber- the move number at the strategic turning point
- All Implemented Interfaces:
StrategicTurningPoint
- Enclosing interface:
StrategicTurningPoint
public static record StrategicTurningPoint.ImmediateLossPrevention(String playerMarker, GameState gameState, int moveNumber)
extends Record
implements StrategicTurningPoint
A strategic turning point where the player has prevented an immediate loss.
-
Nested Class Summary
Nested classes/interfaces inherited from interface StrategicTurningPoint
StrategicTurningPoint.CenterSquareControl, StrategicTurningPoint.GameWon, StrategicTurningPoint.ImmediateLossPrevention, StrategicTurningPoint.PriorityLevel -
Constructor Summary
ConstructorsConstructorDescriptionImmediateLossPrevention(String playerMarker, GameState gameState, int moveNumber) Creates an instance of aImmediateLossPreventionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of thegameStaterecord component.final inthashCode()Returns a hash code value for this object.intReturns the value of themoveNumberrecord component.Returns the value of theplayerMarkerrecord component.The priority level of the strategic turning point.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ImmediateLossPrevention
Creates an instance of aImmediateLossPreventionrecord class.- Parameters:
playerMarker- the value for theplayerMarkerrecord componentgameState- the value for thegameStaterecord componentmoveNumber- the value for themoveNumberrecord component
-
-
Method Details
-
priorityLevel
Description copied from interface:StrategicTurningPointThe priority level of the strategic turning point.- Specified by:
priorityLevelin interfaceStrategicTurningPoint
-
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. -
playerMarker
Returns the value of theplayerMarkerrecord component.- Specified by:
playerMarkerin interfaceStrategicTurningPoint- Returns:
- the value of the
playerMarkerrecord component
-
gameState
Returns the value of thegameStaterecord component.- Specified by:
gameStatein interfaceStrategicTurningPoint- Returns:
- the value of the
gameStaterecord component
-
moveNumber
public int moveNumber()Returns the value of themoveNumberrecord component.- Specified by:
moveNumberin interfaceStrategicTurningPoint- Returns:
- the value of the
moveNumberrecord component
-