Improved documentation in Board
This commit is contained in:
parent
b72a8916a0
commit
c24613ba59
@ -460,12 +460,10 @@ public class Board implements Cloneable {
|
||||
|
||||
// Fullmove counter
|
||||
log.setFullmoveCounter(Integer.parseInt(parts[5]));
|
||||
|
||||
// TODO: Synchronize with game
|
||||
}
|
||||
|
||||
/**
|
||||
* @return A FEN-encoded string representing the board
|
||||
* @return a FEN-encoded string representing the board
|
||||
*/
|
||||
public String toFEN() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
@ -564,26 +562,56 @@ public class Board implements Cloneable {
|
||||
return board;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param pos The position from which to return a piece
|
||||
* @return The piece at the position
|
||||
*/
|
||||
public Piece get(Position pos) {
|
||||
return boardArr[pos.x][pos.y];
|
||||
}
|
||||
|
||||
/**
|
||||
* Places a piece at a position.
|
||||
*
|
||||
* @param pos The position to place the piece at
|
||||
* @param piece The piece to place
|
||||
*/
|
||||
public void set(Position pos, Piece piece) {
|
||||
boardArr[pos.x][pos.y] = piece;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param move The move from which position to return a piece
|
||||
* @return The piece at the position of the move
|
||||
*/
|
||||
public Piece getPos(Move move) {
|
||||
return get(move.pos);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param move The move from which destination to return a piece
|
||||
* @return The piece at the destination of the move
|
||||
*/
|
||||
public Piece getDest(Move move) {
|
||||
return get(move.dest);
|
||||
}
|
||||
|
||||
/**
|
||||
* Places a piece at the position of a move.
|
||||
*
|
||||
* @param move The move at which position to place the piece
|
||||
* @param piece The piece to place
|
||||
*/
|
||||
public void setPos(Move move, Piece piece) {
|
||||
set(move.pos, piece);
|
||||
}
|
||||
|
||||
/**
|
||||
* Places a piece at the destination of a move.
|
||||
*
|
||||
* @param move The move at which destination to place the piece
|
||||
* @param piece The piece to place
|
||||
*/
|
||||
public void setDest(Move move, Piece piece) {
|
||||
set(move.dest, piece);
|
||||
}
|
||||
|
Reference in New Issue
Block a user