Record Class Minesweeper.RevealResult
java.lang.Object
java.lang.Record
net.flectone.pulse.module.command.minesweeper.model.Minesweeper.RevealResult
- Record Components:
state- the game state after the movecellsOpened- how many cells openedhitMine- whether the move hit a mine
- Enclosing class:
Minesweeper
public static record Minesweeper.RevealResult(Minesweeper.GameState state, int cellsOpened, boolean hitMine)
extends Record
What one reveal did to the board.
-
Constructor Summary
ConstructorsConstructorDescriptionRevealResult(Minesweeper.GameState state, int cellsOpened, boolean hitMine) Creates an instance of aRevealResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thecellsOpenedrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanhitMine()Returns the value of thehitMinerecord component.state()Returns the value of thestaterecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
RevealResult
Creates an instance of aRevealResultrecord class.- Parameters:
state- the value for thestaterecord componentcellsOpened- the value for thecellsOpenedrecord componenthitMine- the value for thehitMinerecord component
-
-
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. -
state
-
cellsOpened
public int cellsOpened()Returns the value of thecellsOpenedrecord component.- Returns:
- the value of the
cellsOpenedrecord component
-
hitMine
-