diff options
| author | Charlie Blake | 2018-07-06 17:25:53 +0100 |
|---|---|---|
| committer | Charlie Blake | 2018-07-06 17:25:53 +0100 |
| commit | 4c209e2f5ab9ed7574a9b73eb96687dc5ae77391 (patch) | |
| tree | 634eede8d39d3e313c1206cb2b9a6f6205570f8c /src/main/game/move.cpp | |
| parent | Refactored game rules JSON (diff) | |
| download | metasol-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.cpp | 9 |
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 } |
