aboutsummaryrefslogtreecommitdiff
path: root/src/main/game/move.h
diff options
context:
space:
mode:
authorCharlie Blake2018-06-08 21:54:48 +0100
committerCharlie Blake2018-06-08 21:54:48 +0100
commita7396c5497601855fad019cfd145ca6c93e1c40f (patch)
tree99bdf08b2eb8f15c38a4ddb74c68d45bacd0fae1 /src/main/game/move.h
parentFix built move bug and add unit tests (diff)
downloadmetasol-a7396c5497601855fad019cfd145ca6c93e1c40f.tar.gz
metasol-a7396c5497601855fad019cfd145ca6c93e1c40f.zip

Refactor moves logic

Diffstat (limited to 'src/main/game/move.h')
-rw-r--r--src/main/game/move.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/main/game/move.h b/src/main/game/move.h
index 81a6116..b852811 100644
--- a/src/main/game/move.h
+++ b/src/main/game/move.h
@@ -8,12 +8,15 @@
#include "pile.h"
struct move {
- move(pile::ref , pile::ref, pile::size_type = 1);
- bool is_dominance() const;
+ enum class mtype {regular, dominance, built_group, stock_to_waste, stock_to_tableau, redeal, null};
+
+ explicit move(mtype, pile::ref = 255 , pile::ref = 255, pile::size_type = 1);
friend bool operator==(const move&, const move&);
- const static pile::size_type dominance_flag;
- pile::ref from; pile::ref to; pile::size_type count;
+ mtype type;
+ pile::ref from;
+ pile::ref to;
+ pile::size_type count;
};