private Piece create_piece(int type, boolean w, int x, int y) {
        switch (type) {
            case 1:
                return new Pawn(type, w, x, y);
            case 4:
                return new Bishop(type, w, x, y);
            case 3:
                return new Knight(type, w, x, y);
            case 2:
                return new Rook(type, w, x, y);
            case 5:
                return new Queen(type, w, x, y);                
            case 6:
                return new King(type, w, x, y);                
        }
        return new Pawn(type, w, x, y);
    }