Class Chessboard 

java.lang.Object
   |
   +----Chessboard

public class Chessboard 
extends Object 

Constructor Index 

o Chessboard() 
Default Constructor 

Method Index 

o CheckPiece(boolean, int, int) 
Check to see if the player's piece is at the start coordinate 
o Clear(int, int, boolean) 
Determines if a space is clear 
o DrawBoard(Graphics, Evaluator) 
Draws The Chessboard 
o EvaluateBoard(Evaluator, boolean) 
Evaluates the given board 
o MakeMove(boolean, int, int, int, int, Evaluator) 
Moves the pieces once after move has been validated 
o ValidateInput(int, int) 
o ValidateMove(boolean, int, int, int, int) 
Determine if the move is valid 

Constructors 

o Chessboard 
 public Chessboard()
Default Constructor 

Methods 

o MakeMove 
 public boolean MakeMove(boolean BeBlacksMove,
                         int X1,
                         int Y1,
                         int X2,
                         int Y2,
                         Evaluator applet)
Moves the pieces once after move has been validated 
Parameters: 
BeBlacksMove - true if it is black's move 
X1 - the initial x-coordinate of the piece 
Y1 - the initial y-coordinate of the piece 
X2 - the final x-coordinate of the piece 
Y2 - the final y-coordinate of the piece 
applet - a copy of the Evaluator applet 
Returns: 
true if king is taken 
o CheckPiece 
 public boolean CheckPiece(boolean BeBlacksMove,
                           int X,
                           int Y)
Check to see if the player's piece is at the start coordinate 
Parameters: 
BeBlacksMove - true if it is Black's move 
X - the x coordinate to check 
Y - the y coordinate to check 
Returns: 
true if it is your piece 
o EvaluateBoard 
 public int EvaluateBoard(Evaluator applet,
                          boolean BeBlacksMove)
Evaluates the given board 
Parameters: 
applet - a copy of the Evaluator applet 
BeBlacksMove - true if it is black's move 
Returns: 
returns the total score for the board for the player about to move 
o Clear 
 public boolean Clear(int X,
                      int Y,
                      boolean ClearMove)
Determines if a space is clear 
Parameters: 
X - x-coordinate of the space 
Y - y-coordinate of the space 
ClearMove - the current value of ClearMove from the caller 
Returns: 
true if space is clear 
o ValidateInput 
 public boolean ValidateInput(int x,
                              int y)
Parameters: 
x - x-coordinate of mouse click 
y - y-coordinate of mouse click 
Returns: 
true if mouse click was on chessboard 
o ValidateMove 
 public boolean ValidateMove(boolean BeBlacksMove,
                             int X1,
                             int Y1,
                             int X2,
                             int Y2)
Determine if the move is valid 
Parameters: 
BeBlacksMove - true if it is Black's move 
X1 - the x-coordinate of the piece to move 
Y1 - the y-coordinate of the piece to move 
X2 - the x-coordinate of the space to move to 
Y2 - the x-coordinate of the space to move to 
Returns: 
true if the space is clear 
o DrawBoard 
 public void DrawBoard(Graphics g,
                       Evaluator applet)
Draws The Chessboard 
Parameters: 
graphics - g a graphics object 
applet - a copy of the Evaluator applet