aboutsummaryrefslogtreecommitdiff
path: root/src/main/game/move.cpp
diff options
context:
space:
mode:
authorCharlie Blake2018-07-06 17:25:53 +0100
committerCharlie Blake2018-07-06 17:25:53 +0100
commit4c209e2f5ab9ed7574a9b73eb96687dc5ae77391 (patch)
tree634eede8d39d3e313c1206cb2b9a6f6205570f8c /src/main/game/move.cpp
parentRefactored game rules JSON (diff)
downloadmetasol-4c209e2f5ab9ed7574a9b73eb96687dc5ae77391.tar.gz
metasol-4c209e2f5ab9ed7574a9b73eb96687dc5ae77391.zip

Refactor k-plus impl to simplify and fix deal1 bug

Diffstat (limited to 'src/main/game/move.cpp')
-rw-r--r--src/main/game/move.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main/game/move.cpp b/src/main/game/move.cpp
index 915bac6..528b631 100644
--- a/src/main/game/move.cpp
+++ b/src/main/game/move.cpp
@@ -4,11 +4,12 @@
#include "move.h"
-move::move(mtype ty, pile::ref f, pile::ref t, pile::size_type i, bool reveal_move_) :
- type(ty), from(f), to(t), count(i), reveal_move(reveal_move_) {
+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(i == 1);
- else if (ty != mtype::stock_k_plus) assert(i >= 1);
+ if (ty == mtype::regular) assert(count == 1);
+ if (ty == mtype::stock_k_plus) assert(!reveal_move_);
+ if (ty != mtype::stock_k_plus) assert(count >= 1 && !flip_waste_);
#endif
}