if ( getRenderer().getDraggedPiece() == null ) {
return false; // nothing being dragged
}
BlockadeController controller = (BlockadeController)viewer_.getController();
BlockadeBoard board = (BlockadeBoard) controller.getBoard();
// get the original position.
BlockadeBoardPosition position =
board.getPosition(getRenderer().getDraggedPiece().getLocation());
// valid or not, don't show the dragged piece after releasing the mouse.
getRenderer().setDraggedPiece(null);
BlockadeMove m = checkAndGetValidMove(position, loc);
if (m == null) {
return false;
}
// make sure that the piece shows while we decide where to place the wall.
currentMove = m;
GameContext.log(1, "legal human move :" + m.toString());
position.getPiece().setTransparency((short) 0);
boolean isPlayer1 = position.getPiece().isOwnedByPlayer1();
BlockadeBoardPosition newPosition =
board.getPosition(currentMove.getToRow(), currentMove.getToCol());
newPosition.setPiece(position.getPiece());
position.setPiece(null);
viewer_.refresh();
if (newPosition.isHomeBase( !isPlayer1 )) {