diff options
| author | Charlie Blake | 2018-06-22 16:21:37 +0100 |
|---|---|---|
| committer | Charlie Blake | 2018-06-22 16:21:37 +0100 |
| commit | 3a781e332c2a2d0d03b1eb35f1538929851aedaa (patch) | |
| tree | cbf562aa47561cca2c961b9dba0b73a6300147d4 /src/main/game/search-state | |
| parent | Change move order generation (diff) | |
| download | metasol-3a781e332c2a2d0d03b1eb35f1538929851aedaa.tar.gz metasol-3a781e332c2a2d0d03b1eb35f1538929851aedaa.zip | |
Add simple simon
Diffstat (limited to 'src/main/game/search-state')
| -rw-r--r-- | src/main/game/search-state/game_state.auto_foundation_moves.cpp | 4 | ||||
| -rw-r--r-- | src/main/game/search-state/game_state.legal_moves.cpp | 2 |
2 files changed, 4 insertions, 2 deletions
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<move> 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<pile::ref> 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()); |
