@Override
    public void mouseUp(MouseEvent e, int x, int y) {
        Position newPosition = GfxConstants.getPositionFromXY(x, y);

        boolean negativeX = newPosition.getColumn() >= 0;
        boolean negativeY = newPosition.getRow() >= 0;
        boolean outOfBounceX = newPosition.getColumn() <= GameConstants.WORLDSIZE;
        boolean outOfBounceY = newPosition.getRow() <= GameConstants.WORLDSIZE;

        if (unit != null) {
            if (negativeX && negativeY && outOfBounceX && outOfBounceY) {
                boolean validMove = game.moveUnit(position, newPosition);
                if (validMove) {
                    editor.showStatus(unit.getTypeString() + " has been moved from " + position + " to " + newPosition);
                } else {
                    editor.showStatus("Invalid move");
                }
            } else {
                editor.showStatus("New unit position out of bounce");
            }
        }
        unit = null;
    }