model
Class ChessBoard

java.lang.Object
  extended by model.ChessBoard

public class ChessBoard
extends java.lang.Object

ADT ChessBoard is responsible for portraying the chess board where the game is played.


Constructor Summary
ChessBoard()
          constructor: Creates a new 8X8 square ChessBoard.
 
Method Summary
 Cell getCell(int x, int y)
          accessor(selector): Retrieves the cell at the given position.
 void setCell(int x, int y, Cell z)
          transformer(mutative): Sets the cell at the given position x, y with the parameter z.
 java.lang.String toString()
          accessor(selector): Returns a string representation of the chess board using pipes and underscores.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ChessBoard

public ChessBoard()
constructor: Creates a new 8X8 square ChessBoard.
postcondition: Creates a new ChessBoard.

Method Detail

getCell

public Cell getCell(int x,
                    int y)
             throws IllegalCellException
accessor(selector): Retrieves the cell at the given position.
precondition: Coordinates that are passed by need to correspond to a valid cell. Meaning that, coordinate x, y must be between 0 and 7.
postcondition: Retrieves a chess board's square at a certain position.

Parameters:
x - number of the row in the chess board
y - number of the column in the chess board
Returns:
the Cell at the given position
Throws:
IllegalCellException - if coordinates do not correspond to a valid cell.

setCell

public void setCell(int x,
                    int y,
                    Cell z)
transformer(mutative): Sets the cell at the given position x, y with the parameter z.
precondition: Coordinates that are passed, need to correspond to a valid cell. Meaning coordinate x, y must be between 0 and 7.
postcondition: Sets a chess board's square at a certain position(x,y) with the given cell.

Parameters:
x - number of the row in the chess board
y - number of the column in the chess board
Throws:
IllegalCellException - if coordinates do not correspond to a valid cell.

toString

public java.lang.String toString()
accessor(selector): Returns a string representation of the chess board using pipes and underscores.
postcondition: Returns a String display of the chess board.

Overrides:
toString in class java.lang.Object
Returns:
a String symbolizing the chess board.