From 3a781e332c2a2d0d03b1eb35f1538929851aedaa Mon Sep 17 00:00:00 2001 From: Charlie Blake Date: Fri, 22 Jun 2018 16:21:37 +0100 Subject: Add simple simon --- src/main/game/search-state/game_state.auto_foundation_moves.cpp | 4 +++- src/main/game/search-state/game_state.legal_moves.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src/main/game') diff --git a/src/main/game/search-state/game_state.auto_foundation_moves.cpp b/src/main/game/search-state/game_state.auto_foundation_moves.cpp index 1bec3fe..794c040 100644 --- a/src/main/game/search-state/game_state.auto_foundation_moves.cpp +++ b/src/main/game/search-state/game_state.auto_foundation_moves.cpp @@ -11,7 +11,9 @@ using std::max; bool game_state::is_valid_auto_foundation_move(pile::ref target_pile) const { - if (streamliners || rules.build_pol == pol::NO_BUILD || rules.build_pol == pol::SAME_SUIT) + if (rules.foundations_comp_piles) + return false; + else if (streamliners || rules.build_pol == pol::NO_BUILD || rules.build_pol == pol::SAME_SUIT) return true; card::suit_t target_suit(target_pile - foundations.front()); diff --git a/src/main/game/search-state/game_state.legal_moves.cpp b/src/main/game/search-state/game_state.legal_moves.cpp index 5fb48df..b7b910e 100644 --- a/src/main/game/search-state/game_state.legal_moves.cpp +++ b/src/main/game/search-state/game_state.legal_moves.cpp @@ -117,7 +117,7 @@ vector game_state::get_legal_moves(move parent_move) { } // Tableau / cells to hole / foundation moves - if (rules.hole || rules.foundations) { + if (rules.hole || (rules.foundations && !rules.foundations_comp_piles)) { list from_piles = tableau_piles; if (rules.cells > 0) from_piles.insert(from_piles.end(), cells.begin(), cells.end()); if (rules.reserve_size > 0) from_piles.insert(from_piles.end(), reserve.begin(), reserve.end()); -- cgit v1.2.1