Class CellLogic

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

public class CellLogic extends Object
This class represents a single cell in the puzzle grid. Allows us to not deal with coordinates and just use row and col.
  • Field Details

  • Constructor Details

    • CellLogic

      public CellLogic(int col, int row)
      Create a new cell
      Parameters:
      col - Column of the cell
      row - Row of the cell
  • Method Details

    • getRow

      public int getRow()
      Get the row of the cell
      Returns:
      Row of the cell
    • getCol

      public int getCol()
      Get the column of the cell
      Returns:
      Column of the cell
    • getType

      public CellType getType()
      Get the type of the cell
      Returns:
      Type of the cell
    • setType

      public void setType(CellType type)
      Set the type of the cell
      Parameters:
      type - Type of the cell
    • onClick

      public void onClick(boolean rightClick)
      Called when the cell is clicked
      Parameters:
      rightClick - True if the right mouse button was clicked
    • setGroup

      public void setGroup(int group)
      Set the group of the cell
      Parameters:
      group - Group of the cell
    • getGroup

      public int getGroup()
      Get the group of the cell
      Returns:
      Group of the cell
    • setWall

      public void setWall(int wall)
      Set witch side(s) of the cell has a wall
      Parameters:
      wall - Side to set the wall on
      See Also:
    • getWalls

      public boolean[] getWalls()
      Get the walls of the cell
      Returns:
      Array of walls
      See Also:
    • setSolutionStar

      public void setSolutionStar()
      Set the cell as in the solution
    • isSolutionStar

      public boolean isSolutionStar()
      Check if the cell is in the solution
    • setDrawIcon

      public void setDrawIcon(boolean drawIcon)
      Set if the cell should draw the icon
      Parameters:
      drawIcon - True if the cell should draw the icon
    • shouldDrawIcon

      public boolean shouldDrawIcon()
      Check if the cell should draw the icon
      Returns:
      True if the cell should draw the icon