de.java_chess.javaChess.board
Interface Board

All Known Subinterfaces:
BitBoard

public interface Board
extends java.lang.Cloneable

This interface has to be implemented by any board implementation.


Method Summary
 void doPly(Ply ply)
          Move a piece from one square to another.
 void emptyBoard()
          Remove all the pieces from the board.
 Board getBoardAfterPly(Ply ply)
          Return a new board, that results from a given ply.
 Piece getPiece(Position position)
          Get the piece of a given position.
 void initialPosition()
          Set the pieces to their initial positions.
 void setPiece(Piece piece, Position position)
          Set a piece on a given position.
 

Method Detail

getPiece

public Piece getPiece(Position position)
Get the piece of a given position.
Parameters:
position - The position of the piece.
Returns:
The piece on that position, or null if the square is empty.

emptyBoard

public void emptyBoard()
Remove all the pieces from the board.

initialPosition

public void initialPosition()
Set the pieces to their initial positions.

setPiece

public void setPiece(Piece piece,
                     Position position)
Set a piece on a given position.
Parameters:
piece - The piece to set.
position - The position to set the piece on.

doPly

public void doPly(Ply ply)
Move a piece from one square to another.
Parameters:
ply - The move to perform.

getBoardAfterPly

public Board getBoardAfterPly(Ply ply)
Return a new board, that results from a given ply.
Parameters:
ply - The ply to perform.
Returns:
A new board with the game position after the ply.