Class Minesweeper
java.lang.Object
net.flectone.pulse.module.command.minesweeper.model.Minesweeper
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic enumstatic final record -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckBounds(int row, int column) int[][]intboolean[][]intboolean[][]getMine()intboolean[][]intintgetRows()intgetSeed()getState()intbooleanbooleanrender(String line, Function<Minesweeper.CellView, String> function) reveal(int row, int column) voidrevealAll(boolean clearFlags) voidsetFlagMode(boolean flagMode) voidtoggleFlag(int row, int column)
-
Constructor Details
-
Minesweeper
public Minesweeper(int rows, int columns, int mineCount, int seed)
-
-
Method Details
-
reveal
-
revealAll
public void revealAll(boolean clearFlags) -
toggleFlag
public void toggleFlag(int row, int column) -
render
-
checkBounds
public boolean checkBounds(int row, int column) -
getRows
public int getRows() -
getColumns
public int getColumns() -
getMineCount
public int getMineCount() -
getSeed
public int getSeed() -
getTotalSafeCellCount
public int getTotalSafeCellCount() -
getRandom
-
getMine
public boolean[][] getMine() -
getAdjacentMineCount
public int[][] getAdjacentMineCount() -
getRevealed
public boolean[][] getRevealed() -
getFlagged
public boolean[][] getFlagged() -
isFlagMode
public boolean isFlagMode() -
isMinesPlaced
public boolean isMinesPlaced() -
getState
-
getRevealedSafeCellCount
public int getRevealedSafeCellCount() -
getFlaggedCellCount
public int getFlaggedCellCount() -
setFlagMode
public void setFlagMode(boolean flagMode)
-