From 8dba2d3a176d1381cf9c3ed31192c31a468608f1 Mon Sep 17 00:00:00 2001 From: thecharlesblake Date: Mon, 5 Feb 2018 15:58:09 +0000 Subject: Add removable foundations logic to legal moves gen --- src/main/game/game_state.legal_moves.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/main/game') diff --git a/src/main/game/game_state.legal_moves.cpp b/src/main/game/game_state.legal_moves.cpp index 3043587..fb08abb 100644 --- a/src/main/game/game_state.legal_moves.cpp +++ b/src/main/game/game_state.legal_moves.cpp @@ -24,6 +24,14 @@ vector game_state::get_legal_moves() const { // Never removes a card from the hole, the waste, or an empty pile if (rem_ref == hole || piles[rem_ref].empty()) continue; + // If the foundations aren't removable, also skip them + if (rules.foundations + && !rules.foundations_removable + && rem_ref >= foundations.front() + && rem_ref <= foundations.back()) { + continue; + } + // Stock cards can only be moved to the waste (assuming there is a waste) if (rules.stock_size > 0 && rem_ref == stock) { if (rules.stock_deal_t == sdt::WASTE) { -- cgit v1.2.1