Package com.amirhn.Game
Class Chess
java.lang.Object
com.amirhn.Game.Chess
The type Chess.
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe Black player.The History.The Moves.static final StringThe constant OriginalFen.The Turn.The White player. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanApply move boolean.Gets allowed moves.getBoard()Gets board.Gets opponent player.Gets player.Gets random move.Gets status.Gets turn player.booleanIs 50 move rule boolean.booleanIs checkmate boolean.booleanisDraw()Is draw boolean.booleanIs in check boolean.booleanIs stalemate boolean.booleanIs threefold repetition boolean.moveFromString(String moveString) Move from string move.voidSets piece.voidSets fen.toString()To string string.voidundoMove()Undo move.
-
Field Details
-
OriginalFen
The constant OriginalFen.- See Also:
-
whitePlayer
The White player. -
blackPlayer
The Black player. -
moves
The Moves. -
turn
The Turn. -
history
The History.
-
-
Constructor Details
-
Chess
public Chess()Instantiates a new Chess. -
Chess
Instantiates a new Chess.- Parameters:
fen- the fen
-
-
Method Details
-
setupFEN
Sets fen.- Parameters:
fen- the fen
-
setPiece
Sets piece.- Parameters:
piece- the piece
-
getBoard
Gets board.- Returns:
- the board
-
getTurnPlayer
Gets turn player.- Returns:
- the turn player
-
getOpponentPlayer
Gets opponent player.- Returns:
- the opponent player
-
getPlayer
Gets player.- Parameters:
color- the color- Returns:
- the player
-
getAllowedMoves
Gets allowed moves.- Returns:
- the allowed moves
-
getRandomMove
Gets random move.- Returns:
- the random move
-
applyMove
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
Gets status.- Returns:
- the status
-
undoMove
public void undoMove()Undo move. -
moveFromString
Move from string move.- Parameters:
moveString- the move string- Returns:
- the move
-
toString
To string string.
-