Class Chess

java.lang.Object
com.amirhn.Game.Chess

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

    • OriginalFen

      public static final String OriginalFen
      The constant OriginalFen.
      See Also:
    • whitePlayer

      public Player whitePlayer
      The White player.
    • blackPlayer

      public Player blackPlayer
      The Black player.
    • moves

      public List<Move> moves
      The Moves.
    • turn

      public Color turn
      The Turn.
    • history

      public List<Scene> history
      The History.
  • Constructor Details

    • Chess

      public Chess()
      Instantiates a new Chess.
    • Chess

      public Chess(String fen)
      Instantiates a new Chess.
      Parameters:
      fen - the fen
  • Method Details

    • setupFEN

      public void setupFEN(String fen)
      Sets fen.
      Parameters:
      fen - the fen
    • setPiece

      public void setPiece(Piece piece)
      Sets piece.
      Parameters:
      piece - the piece
    • getBoard

      public Board getBoard()
      Gets board.
      Returns:
      the board
    • getTurnPlayer

      public Player getTurnPlayer()
      Gets turn player.
      Returns:
      the turn player
    • getOpponentPlayer

      public Player getOpponentPlayer()
      Gets opponent player.
      Returns:
      the opponent player
    • getPlayer

      public Player getPlayer(Color color)
      Gets player.
      Parameters:
      color - the color
      Returns:
      the player
    • getAllowedMoves

      public List<Move> getAllowedMoves()
      Gets allowed moves.
      Returns:
      the allowed moves
    • getRandomMove

      public Move getRandomMove()
      Gets random move.
      Returns:
      the random move
    • applyMove

      public boolean applyMove(Move move)
      Apply move boolean.
      Parameters:
      move - the move
      Returns:
      the boolean
    • isInCheck

      public boolean isInCheck()
      Is in check boolean.
      Returns:
      the boolean
    • isCheckmate

      public boolean isCheckmate()
      Is checkmate boolean.
      Returns:
      the boolean
    • isStalemate

      public boolean isStalemate()
      Is stalemate boolean.
      Returns:
      the boolean
    • isThreefoldRepetition

      public boolean isThreefoldRepetition()
      Is threefold repetition boolean.
      Returns:
      the boolean
    • is50MoveRule

      public boolean is50MoveRule()
      Is 50 move rule boolean.
      Returns:
      the boolean
    • isDraw

      public boolean isDraw()
      Is draw boolean.
      Returns:
      the boolean
    • getStatus

      public Status getStatus()
      Gets status.
      Returns:
      the status
    • undoMove

      public void undoMove()
      Undo move.
    • moveFromString

      public Move moveFromString(String moveString)
      Move from string move.
      Parameters:
      moveString - the move string
      Returns:
      the move
    • toString

      public String toString()
      To string string.
      Overrides:
      toString in class Object
      Returns:
      the string