aboutsummaryrefslogtreecommitdiff
path: root/src/main/game
diff options
context:
space:
mode:
authorthecharlesblake2018-01-04 15:48:01 +0000
committerthecharlesblake2018-01-04 15:48:01 +0000
commit73b6928f29a231b1294144100e6cf099c8dd90a9 (patch)
tree8d54dde2200aadb043d7c76a4c41971c8562dbea /src/main/game
parentAdd state printing for regular reserve (diff)
downloadmetasol-73b6928f29a231b1294144100e6cf099c8dd90a9.tar.gz
metasol-73b6928f29a231b1294144100e6cf099c8dd90a9.zip

Add legal move gen for reserve

Diffstat (limited to 'src/main/game')
-rw-r--r--src/main/game/game_state.legal_moves.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/game/game_state.legal_moves.cpp b/src/main/game/game_state.legal_moves.cpp
index 9369734..10a9639 100644
--- a/src/main/game/game_state.legal_moves.cpp
+++ b/src/main/game/game_state.legal_moves.cpp
@@ -17,8 +17,7 @@ vector<game_state::move> game_state::get_legal_moves() const {
// Cycles through each pile which we may be able to remove a card from
for (pile_ref rem_ref = 0; rem_ref < piles.size(); rem_ref++) {
// Never removes a card from the hole, the waste, or an empty pile
- if (rem_ref == hole
- || piles[rem_ref].empty()) continue;
+ if (rem_ref == hole || piles[rem_ref].empty()) continue;
// Stock cards can only be moved to the waste
if (stock != PILE_REF_MAX && rem_ref == stock) {
@@ -53,6 +52,9 @@ vector<game_state::move> game_state::get_legal_moves() const {
if (hole != PILE_REF_MAX && is_valid_hole_move(rem_ref)) {
moves.emplace_back(rem_ref, hole);
}
+
+ // Note that the stock and the reserve aren't mentioned here, as
+ // they cannot be added to
}
return moves;