Class Minesweeper

java.lang.Object
net.flectone.pulse.module.command.minesweeper.model.Minesweeper

public class Minesweeper extends Object
  • Constructor Details

    • Minesweeper

      public Minesweeper(int rows, int columns, int mineCount, int seed)
  • Method Details

    • reveal

      public Minesweeper.RevealResult reveal(int row, int column)
    • revealAll

      public void revealAll(boolean clearFlags)
    • toggleFlag

      public void toggleFlag(int row, int column)
    • render

      public String render(String line, Function<Minesweeper.CellView, String> function)
    • 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

      public Random 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

      public Minesweeper.GameState getState()
    • getRevealedSafeCellCount

      public int getRevealedSafeCellCount()
    • getFlaggedCellCount

      public int getFlaggedCellCount()
    • setFlagMode

      public void setFlagMode(boolean flagMode)