summaryrefslogtreecommitdiff
path: root/src/helper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/helper.cpp')
-rw-r--r--src/helper.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/helper.cpp b/src/helper.cpp
index ff5ed61..cdd9762 100644
--- a/src/helper.cpp
+++ b/src/helper.cpp
@@ -344,3 +344,15 @@ canPlace(struct piece_t* piece,
return true;
}
+
+void
+clearPiece(std::shared_ptr<std::vector<struct piece_t>> pieces, struct piece_t* piece)
+{
+ for (int i = 0; i < pieces->size(); i++) {
+ auto& p = (*pieces)[i];
+ if (p.id == piece->id) {
+ pieces->erase(pieces->begin() + i);
+ break;
+ }
+ }
+}