Class King


public class King extends Piece
The type King.
  • Constructor Details

    • King

      public King(Color color, Location location)
      Instantiates a new King.
      Parameters:
      color - the color
      location - the location
  • Method Details

    • canBeCapturedBy

      public boolean canBeCapturedBy(Piece piece)
      Can be captured by boolean.
      Overrides:
      canBeCapturedBy in class Piece
      Parameters:
      piece - the piece
      Returns:
      the boolean
    • getThreatenedLocations

      public List<Location> getThreatenedLocations(Board board)
      Gets threatened locations.
      Specified by:
      getThreatenedLocations in class Piece
      Parameters:
      board - the board
      Returns:
      the threatened locations
    • getNaturalMoves

      public List<Move> getNaturalMoves(Board board)
      Gets natural moves.
      Overrides:
      getNaturalMoves in class Piece
      Parameters:
      board - the board
      Returns:
      the natural moves