Ejemplo n.º 1
0
 /**
  * Removes the piece at the specified location
  *
  * @param String - specified location
  * @return String - return message indicating whether the piece was removed successfully or not
  */
 public String removePieceAt(String pos) {
   int ret = _chessBoard.removePieceAt(pos);
   if (ret != 0) return ChessConstants.toString(ret);
   return "Piece Removed Successfully";
 }
Ejemplo n.º 2
0
 /**
  * Returns the type of the piece at the specified location
  *
  * @param String - specified location
  * @return String - return message containing the type of the piece
  */
 public String getPieceAt(String pos) {
   return ChessConstants.toString(_chessBoard.getPieceAt(pos));
 }
Ejemplo n.º 3
0
 /**
  * This method moves a specified piece from src position to dst position
  *
  * @param String - source position
  * @param String - destination position
  * @return String - return message indicating whether the move was successful or not
  */
 public String move(String src, String dst) {
   int ret = _chessBoard.movePiece(src, dst);
   if (ret != 0) return ChessConstants.toString(ret);
   return "Move Completed Successfully!";
 }