|
Internet Chess ToolKit v0.2.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ictk.boardgame.Piece ictk.boardgame.chess.ChessPiece ictk.boardgame.chess.King
Field Summary | |
static byte |
INDEX
|
Fields inherited from class ictk.boardgame.chess.ChessPiece |
BLACK_OFFSET, NULL_PIECE |
Constructor Summary | |
King()
|
|
King(boolean blackness)
|
|
King(boolean blackness,
Square o,
ChessBoard _board)
|
Method Summary | |
Square |
getKingsideCastleSquare()
these functions are used so variants can override them |
Square |
getQueensideCastleSquare()
these functions are used so variants can override them |
boolean |
isBlockable(Square target)
|
boolean |
isBlockable(Square blocker,
ChessPiece target)
checks to see if another piece may be able to intercede between the piece's origin and destination square |
boolean |
isCastleableKingside()
Checks to see if a future move can include a King-side castle. |
boolean |
isCastleableQueenside()
can a future move include a Queen-side castle? |
boolean |
isInCheck()
is this King currently threatened. |
boolean |
isKing()
|
boolean |
isLegalAttack(Square target)
same as isLegalDests except for special moves like castle and pawn moves. |
void |
setCastleableKingside(boolean t)
sets the castleable bit for the Kingside. |
void |
setCastleableQueenside(boolean t)
sets the castleable bit for the Queenside. |
Methods inherited from class ictk.boardgame.chess.ChessPiece |
dump, getBoard, getGuardSquares, getIndex, getLegalDests, getLineOfSight, getLineOfSight, getLineOfSight, getPinnedBy, getSquare, isBishop, isBlack, isCaptured, isGuarding, isGuarding, isKnight, isLegalDest, isPawn, isQueen, isRook, removeLegalDests, setBoard, setCaptured, toChessPiece, toString |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final byte INDEX
Constructor Detail |
public King()
public King(boolean blackness)
public King(boolean blackness, Square o, ChessBoard _board)
Method Detail |
public Square getQueensideCastleSquare()
public Square getKingsideCastleSquare()
public boolean isInCheck()
public boolean isCastleableQueenside()
public boolean isCastleableKingside()
public void setCastleableQueenside(boolean t)
java.lang.IllegalStateException
- of there's no rook on that side to castle
with.public void setCastleableKingside(boolean t)
java.lang.IllegalStateException
- of there's no rook on that side to castle
with.public boolean isBlockable(Square target)
public boolean isBlockable(Square blocker, ChessPiece target)
ChessPiece
isBlockable
in class ChessPiece
blocker
- - the proposed square that can block the attacktarget
- - the piece under attack
public boolean isLegalAttack(Square target)
ChessPiece
isLegalAttack
in class ChessPiece
public boolean isKing()
isKing
in class ChessPiece
|
Submit a bug or feature Visit the Website Internet Chess ToolKit is licensed under the GPL v2 . |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |