aboutsummaryrefslogtreecommitdiff
path: root/solvitaire/src/main/game/move.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'solvitaire/src/main/game/move.cpp')
-rw-r--r--solvitaire/src/main/game/move.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/solvitaire/src/main/game/move.cpp b/solvitaire/src/main/game/move.cpp
new file mode 100644
index 0000000..b349ddd
--- /dev/null
+++ b/solvitaire/src/main/game/move.cpp
@@ -0,0 +1,25 @@
+//
+// Created by thecharlesblake on 07/06/18.
+//
+
+#include "move.h"
+
+move::move(mtype ty, pile::ref f, pile::ref t, int8_t count_, bool reveal_move_, bool flip_waste_) :
+ type(ty), from(f), to(t), count(count_), reveal_move(reveal_move_), flip_waste(flip_waste_) {
+#ifndef NDEBUG
+ if (ty == mtype::regular) assert(count == 1);
+ if (ty == mtype::stock_k_plus) assert(!reveal_move_);
+#endif
+}
+
+void move::make_reveal_move() {
+ reveal_move = true;
+}
+
+bool operator==(const move& a, const move& b) {
+ return (a.from == b.from )
+ && (a.to == b.to )
+ && (a.count == b.count)
+ && (a.type == b.type )
+ && (a.reveal_move == b.reveal_move);
+}