Package webb.client.logic.puzzle
Class PuzzleLogic
java.lang.Object
webb.client.logic.puzzle.PuzzleLogic
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckBoard(boolean visible) Primary method for checking and setting if stars are in valid locationsgetCell(int col, int row) Get a cell at a specific positionintintvoidonClick(CellComponent c, boolean rightClick, boolean visible) Mirrors changeType from CellDTO while also clearing adjacently marked cells if c is cleared.voidvoidsetGridSize(int size) Sets the size of the grid, and resets the cellsvoidsetPuzzle(CreatePuzzleLevelDTO puzzle) Set the puzzle to be displayed
-
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
-
onClick
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
Get a cell at a specific position- Parameters:
col- Column of the cellrow- 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()
-