Module org.example

Class Bishop

java.lang.Object
cz.cvut.fel.pjv.model.Pieces.Piece
cz.cvut.fel.pjv.model.Pieces.Bishop
All Implemented Interfaces:
java.io.Serializable

public class Bishop
extends Piece
Class representation of the bishop piece.
See Also:
Serialized Form
  • Field Summary

    Fields inherited from class cz.cvut.fel.pjv.model.Pieces.Piece

    BACK, BLACK, GREEN, RESET, WHITE
  • Constructor Summary

    Constructors
    Constructor Description
    Bishop​(boolean white)
    Create bishop piece
  • Method Summary

    Modifier and Type Method Description
    boolean canMove​(Board board, Spot start, Spot end)
    Methode to validate if the move is possible.
    java.lang.String getPieceSymbol()
    Method to get a symbol of the piece for print on board.
    java.lang.String toString()
    Method to get a symbol of the piece for print on console board.

    Methods inherited from class cz.cvut.fel.pjv.model.Pieces.Piece

    isChecking, isKilled, isKingInDanger, isWhite, setKilled, setWhite

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Bishop

      public Bishop​(boolean white)
      Create bishop piece
      Parameters:
      white - If is white, set to true.
  • Method Details

    • canMove

      public boolean canMove​(Board board, Spot start, Spot end) throws java.lang.Exception
      Methode to validate if the move is possible.
      Specified by:
      canMove in class Piece
      Parameters:
      board - Game board.
      start -
      end -
      Returns:
      If move is possible, true.
      Throws:
      java.lang.Exception
    • getPieceSymbol

      public java.lang.String getPieceSymbol()
      Method to get a symbol of the piece for print on board.
      Specified by:
      getPieceSymbol in class Piece
      Returns:
    • toString

      public java.lang.String toString()
      Method to get a symbol of the piece for print on console board.
      Overrides:
      toString in class java.lang.Object
      Returns: