Internet Chess ToolKit
v0.2.0

ictk.boardgame.chess
Class Rook

java.lang.Object
  extended byictk.boardgame.Piece
      extended byictk.boardgame.chess.ChessPiece
          extended byictk.boardgame.chess.Rook

public class Rook
extends ChessPiece


Field Summary
static byte INDEX
           
 
Fields inherited from class ictk.boardgame.chess.ChessPiece
BLACK_OFFSET, NULL_PIECE
 
Constructor Summary
Rook()
           
Rook(boolean blackness)
           
Rook(boolean blackness, Square o, ChessBoard _board)
           
 
Method Summary
 void adjustPinsLegalDests(ChessPiece king, java.util.List enemyTeam)
           
 Square[] getLineOfSight(ChessPiece target, boolean inclusive)
          get all the squares between two squares along a line (diag or straight).
 Square[] getLineOfSight(int t_file, int t_rank, boolean inclusive)
           
 Square[] getLineOfSight(Square target, boolean inclusive)
           
 boolean isRook()
           
 
Methods inherited from class ictk.boardgame.chess.ChessPiece
dump, getBoard, getGuardSquares, getIndex, getLegalDests, getPinnedBy, getSquare, isBishop, isBlack, isBlockable, isCaptured, isGuarding, isGuarding, isKing, isKnight, isLegalAttack, isLegalDest, isPawn, isQueen, removeLegalDests, setBoard, setCaptured, toChessPiece, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INDEX

public static final byte INDEX
See Also:
Constant Field Values
Constructor Detail

Rook

public Rook()

Rook

public Rook(boolean blackness)

Rook

public Rook(boolean blackness,
            Square o,
            ChessBoard _board)
Method Detail

adjustPinsLegalDests

public void adjustPinsLegalDests(ChessPiece king,
                                 java.util.List enemyTeam)

getLineOfSight

public Square[] getLineOfSight(ChessPiece target,
                               boolean inclusive)
Description copied from class: ChessPiece
get all the squares between two squares along a line (diag or straight). Useful for Queens, Rooks and Bishops in determining legal moves and attacks on the King.

Overrides:
getLineOfSight in class ChessPiece
Parameters:
inclusive - include the target square in the return set
Returns:
squares in line starting with this peice to target if the squares are not in line then null is returned

getLineOfSight

public Square[] getLineOfSight(Square target,
                               boolean inclusive)
Overrides:
getLineOfSight in class ChessPiece

getLineOfSight

public Square[] getLineOfSight(int t_file,
                               int t_rank,
                               boolean inclusive)
Overrides:
getLineOfSight in class ChessPiece

isRook

public boolean isRook()
Overrides:
isRook in class ChessPiece

Submit a bug or feature
Visit the Website
Internet Chess ToolKit is licensed under the GPL v2 .