From 73b6928f29a231b1294144100e6cf099c8dd90a9 Mon Sep 17 00:00:00 2001 From: thecharlesblake Date: Thu, 4 Jan 2018 15:48:01 +0000 Subject: Add legal move gen for reserve --- src/main/game/game_state.legal_moves.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') 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::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::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; -- cgit v1.2.1