java.lang.Object
antichess.Piece
antichess.King
- public class King
- extends Piece
This class contains the rules that apply to King.
It implements castling as a special move.
| Fields inherited from class antichess.Piece |
BISHOP, BLACK, BLUE, dcol, drow, EMPTY, FIRSTCOLOR, FIRSTPIECE, KING, KNIGHT, LASTCOLOR, LASTPIECE, offsets, PAWN, PIECECOUNT, PIECEVALUE, playerColorString, QUEEN, RED, ROOK, slide, WHITE |
|
Constructor Summary |
King(char letter,
Board b,
int col,
int row,
int color)
Creates a new piece. |
| Methods inherited from class antichess.Piece |
addEmpty, canAttackLocation, equals, equals, getAllValidMoves, getBoard, getChar, getCol, getColor, getLastCol, getLastRow, getMoved, getNormalMoves, getOpponentColor, getOpponentColor, getRow, getStandardValidMoves, getSwitchMoves, getType, getValidMoves, getValidMovesNormalChess, isGameOver, isGameOver, isGameOverNormalChess, isLoseNormalChess, isTie, isTie, isTieNormalChess, isValidMove, isWin, isWin, kingInCheck, makeCaptureMove, makeGeneratedMove, makeGeneratedMove, makeMove, makeMove, makeMove, makeMove, setBoard, setColor, setLastLocation, setLocation, setMoved, swapPieces, toString, undoCaptureMove, undoMove |
cOffsets
int cOffsets
cDCol
int[] cDCol
cDRow
int[] cDRow
cPieceCount
int[][] cPieceCount
cPieceType
int[][] cPieceType
cSlide
int[][] cSlide
King
public King(char letter,
Board b,
int col,
int row,
int color)
- Creates a new piece.
copyPiece
public Piece copyPiece(Board b)
- Creates a copy to a new board
- Overrides:
copyPiece in class Piece
getOtherMoves
public java.util.List getOtherMoves()
- Overrides getOtherMoves in Piece and retrieves castling moves.
- Overrides:
getOtherMoves in class Piece
getCastlingMoves
private java.util.List getCastlingMoves()
- Returns a list of castling moves the King can make
Overrides getSpecialMoves in Piece.
inCheckOld
public boolean inCheckOld()
inCheckAll
public boolean inCheckAll()
makeOtherMove
public void makeOtherMove(Move move)
- Overrides makeOtherMove in Piece. Implements castling
- Overrides:
makeOtherMove in class Piece
undoOtherMove
public void undoOtherMove(Move move)
- Overrides undoOtherMove in Piece. Implements undo castling
- Overrides:
undoOtherMove in class Piece
inCheck
public boolean inCheck()