Class PuzzleLogic

java.lang.Object
webb.client.logic.puzzle.PuzzleLogic

public class PuzzleLogic extends Object
  • Constructor Details

    • PuzzleLogic

      public PuzzleLogic()
  • Method Details

    • setGridSize

      public void setGridSize(int size)
      Sets the size of the grid, and resets the cells
      Parameters:
      size - Size of the grid
    • setPuzzle

      public void setPuzzle(CreatePuzzleLevelDTO puzzle)
      Set the puzzle to be displayed
      Parameters:
      puzzle - Puzzle to be displayed
    • onClick

      public void onClick(CellComponent c, boolean rightClick, boolean visible)
      Mirrors changeType from CellDTO while also clearing adjacently marked cells if c is cleared.
      Parameters:
      c -
      rightClick -
      visible -
    • checkBoard

      public void checkBoard(boolean visible)
      Primary method for checking and setting if stars are in valid locations
      Parameters:
      visible -
    • printBoard

      public void printBoard()
    • getCell

      public CellComponent getCell(int col, int row)
      Get a cell at a specific position
      Parameters:
      col - Column of the cell
      row - Row of the cell
      Returns:
      The cell at the specified position
      Throws:
      IllegalArgumentException - if the position is invalid
    • getGridSize

      public int getGridSize()
    • getNumStars

      public int getNumStars()