Class King 

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

public class King 
extends Chesspiece 

Constructor Index 

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

Method Index 

o HaveCastled() 
Check and see if king has moved 
o IsCastle(int, int, Chesspiece[][]) 
Determines if the move is a valid attempt at castling 
o Moved() 
Tells the king he has castled or given up castling rights 
o TellMeWhereIAm(int, int) 
Tells the pieces its new location after moving 
o ValidMove(int, int, boolean, Chesspiece[][]) 
Validates a given position 

Constructors 

o King 
 public King(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: 
Row - is row coordinate, 
Col - is column coordinate 
Overrides: 
TellMeWhereIAm in class Chesspiece 
o HaveCastled 
 public boolean HaveCastled()
Check and see if king has moved 
Returns: 
true if king has moved ( and thus, cannot castle ) 
Overrides: 
HaveCastled in class Chesspiece 
o Moved 
 public void Moved()
Tells the king he has castled or given up castling rights 
Overrides: 
Moved in class Chesspiece 
o IsCastle 
 public boolean IsCastle(int X,
                         int Y,
                         Chesspiece Board[][])
Determines if the move is a valid attempt at castling 
Parameters: 
X - x-coordinate of target 
Y - y-coordinate of target 
Board - the current chessboard 
Returns: 
True if the move is a valid castle 
Overrides: 
IsCastle 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