Class Player

java.lang.Object
com.amirhn.Players.Player

public class Player extends Object
The type Player.
  • Field Details

    • capturedPieces

      public List<Piece> capturedPieces
      The Captured pieces.
    • hadLongCastling

      public boolean hadLongCastling
      The Had long castling.
    • hadShortCastling

      public boolean hadShortCastling
      The Had short castling.
  • Constructor Details

    • Player

      public Player(Color color)
      Instantiates a new Player.
      Parameters:
      color - the color
  • Method Details

    • getColor

      public Color getColor()
      Gets color.
      Returns:
      the color
    • getActivePieces

      public List<Piece> getActivePieces(Board board)
      Gets active pieces.
      Parameters:
      board - the board
      Returns:
      the active pieces
    • getNaturalMoves

      public List<Move> getNaturalMoves(Board board)
      Gets natural moves.
      Parameters:
      board - the board
      Returns:
      the natural moves
    • getAllowedMoves

      public List<Move> getAllowedMoves(Chess chess)
      Gets allowed moves.
      Parameters:
      chess - the chess
      Returns:
      the allowed moves
    • getThreatenedLocations

      public List<Location> getThreatenedLocations(Board board)
      Gets threatened locations.
      Parameters:
      board - the board
      Returns:
      the threatened locations
    • getPieces

      public List<Piece> getPieces(Board board, PieceType pieceType)
      Gets pieces.
      Parameters:
      board - the board
      pieceType - the piece type
      Returns:
      the pieces
    • getKing

      public King getKing(Board board)
      Gets king.
      Parameters:
      board - the board
      Returns:
      the king
    • getRooks

      public List<Rook> getRooks(Board board)
      Gets rooks.
      Parameters:
      board - the board
      Returns:
      the rooks
    • getKingSideRook

      public Rook getKingSideRook(Board board)
      Gets king side rook.
      Parameters:
      board - the board
      Returns:
      the king side rook
    • getQueenSideRook

      public Rook getQueenSideRook(Board board)
      Gets queen side rook.
      Parameters:
      board - the board
      Returns:
      the queen side rook
    • isThreatening

      public boolean isThreatening(Board board, Location location)
      Is threatening boolean.
      Parameters:
      board - the board
      location - the location
      Returns:
      the boolean