aboutsummaryrefslogtreecommitdiff
path: root/src/main/game/move.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/game/move.cpp')
-rw-r--r--src/main/game/move.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/main/game/move.cpp b/src/main/game/move.cpp
new file mode 100644
index 0000000..ff8269c
--- /dev/null
+++ b/src/main/game/move.cpp
@@ -0,0 +1,19 @@
+//
+// Created by thecharlesblake on 07/06/18.
+//
+
+#include "move.h"
+
+move::move(mtype ty, pile::ref f, pile::ref t, pile::size_type i) : type(ty), from(f), to(t), count(i) {
+#ifndef NDEBUG
+ if (ty == mtype::regular) assert(i == 1);
+ else assert(i >= 1);
+#endif
+}
+
+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 );
+}