From 8f02054674b582f575371702cb1ec15359b5bce5 Mon Sep 17 00:00:00 2001 From: Stephen Enders Date: Thu, 28 Jan 2021 21:14:33 -0500 Subject: Score on final position Will score and remove the piece upon moving into the final pos --- src/helper.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/helper.cpp') 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> 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; + } + } +} -- cgit v1.2.3-54-g00ecf