Skip to content

Commit

Permalink
Merge pull request #248 from qwerty084/feat/remove-piece
Browse files Browse the repository at this point in the history
1.3.3
  • Loading branch information
qwerty084 authored Mar 2, 2024
2 parents eae3678 + 4ef7ec4 commit a841c74
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue3-chessboard",
"version": "1.3.2",
"version": "1.3.3",
"description": "vue3-chessboard is a component library for creating chess web apps with vue3",
"homepage": "https://qwerty084.github.io/vue3-chessboard-docs/",
"keywords": [
Expand Down
10 changes: 10 additions & 0 deletions src/classes/BoardApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,16 @@ export class BoardApi {
}
}

/**
* Removes a piece from the board.
* @param square - The square where the piece is located.
*/
removePiece(square: Square): void {
const pieces = this.board.state.pieces;
pieces.delete(square);
this.game.remove(square);
}

/**
* removes all pieces from the board
*/
Expand Down

0 comments on commit a841c74

Please sign in to comment.