summaryrefslogtreecommitdiff
path: root/src/helper.cpp
diff options
context:
space:
mode:
authorStephen Enders <smenders@gmail.com>2021-01-28 21:14:33 -0500
committerStephen Enders <smenders@gmail.com>2021-01-28 21:14:33 -0500
commit8f02054674b582f575371702cb1ec15359b5bce5 (patch)
tree5d6ecb75437e62d5d28629ad7ac9328ea1e4bb9d /src/helper.cpp
parent6efca6678e777edacfc0bae4bf9f201d22a73860 (diff)
Score on final position
Will score and remove the piece upon moving into the final pos
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;
+ }
+ }
+}