Class PieceDecorator

java.lang.Object
javachess.decorators.PieceDecorator
Direct Known Subclasses:
BishopDecorator, CastlingDecorator, EnPassantDecorator, KingDecorator, KnightDecorator, PawnDecorator, RookDecorator

public abstract class PieceDecorator extends Object
  • Field Details

    • board

      protected Board board
    • piece

      protected Piece piece
  • Constructor Details

    • PieceDecorator

      public PieceDecorator()
  • Method Details

    • getValidCells

      public ArrayList<Cell> getValidCells()
    • checkValidCell

      protected void checkValidCell(Cell cell, Position nextCellPos, BiMap<Position,Cell> cells, ArrayList<Cell> validCells)
      Check if the next cell is valid and add it to the list of valid cells.
      Parameters:
      cell - The current cell.
      nextCellPos - The position of the cell we want to check.
      cells - The map of cells.
      validCells - The list of valid cells.