Class Castle 

java.lang.Object
   |
   +----Chesspiece
           |
           +----Castle

public class Castle 
extends Chesspiece 

Constructor Index 

o Castle(Chessboard, boolean, int, int) 
Default constructor 

Method Index 

o HaveMoved() 
Check and see if rook has moved 
o Moved() 
Tells the king he has castled or given up castling rights Overridden in King.java 
o TellMeWhereIAm(int, int) 
Tells the pieces its new location after moving 
o ValidMove(int, int, boolean, Chesspiece[][]) 
Validates a given position 

Constructors 

o Castle 
 public Castle(Chessboard Board,
               boolean BeBlack,
               int Row,
               int Col)
Default constructor 

Methods 

o TellMeWhereIAm 
 public void TellMeWhereIAm(int Col,
                            int Row)
Tells the pieces its new location after moving 
Parameters: 
Col - column coordinate 
Row - row coordinate 
Overrides: 
TellMeWhereIAm in class Chesspiece 
o HaveMoved 
 public boolean HaveMoved()
Check and see if rook has moved 
Returns: 
true if rook has moved yet ( used for castling ) 
Overrides: 
HaveMoved in class Chesspiece 
o Moved 
 public void Moved()
Tells the king he has castled or given up castling rights Overridden in King.java 
Overrides: 
Moved in class Chesspiece 
o ValidMove 
 public boolean ValidMove(int X,
                          int Y,
                          boolean Taking,
                          Chesspiece Board[][])
Validates a given position 
Parameters: 
X - x-coordinate of move 
Y - y-coordinate of move 
Taking - true if we are capturing opponent's piece 
Board - the chessboard currently in play 
Returns: 
true if move is valid 
Overrides: 
ValidMove in class Chesspiece