diff options
| author | thecharlesblake | 2018-10-14 13:08:51 +0100 |
|---|---|---|
| committer | thecharlesblake | 2018-10-14 13:08:51 +0100 |
| commit | f92c4ef763bbd3e0d8dc1145121e3af5d3ea16cf (patch) | |
| tree | e2a941215006fecf4bd0379e3b6dbf7494ed0720 /src/main/game | |
| parent | Merge pull request #98 from thecharlesblake/deal-print (diff) | |
| download | metasol-f92c4ef763bbd3e0d8dc1145121e3af5d3ea16cf.tar.gz metasol-f92c4ef763bbd3e0d8dc1145121e3af5d3ea16cf.zip | |
Add pre-filled cells
Diffstat (limited to 'src/main/game')
| -rw-r--r-- | src/main/game/search-state/game_state.cpp | 9 | ||||
| -rw-r--r-- | src/main/game/sol_rules.cpp | 1 | ||||
| -rw-r--r-- | src/main/game/sol_rules.h | 1 |
3 files changed, 11 insertions, 0 deletions
diff --git a/src/main/game/search-state/game_state.cpp b/src/main/game/search-state/game_state.cpp index 36f92d7..6cd1262 100644 --- a/src/main/game/search-state/game_state.cpp +++ b/src/main/game/search-state/game_state.cpp @@ -166,6 +166,15 @@ game_state::game_state(const sol_rules& s_rules, int seed, streamliner_options s place_card(foundations[(f_idx + rand_suit)], c); } + // If there are pre-filled cells, deals to them + auto it = begin(original_cells); + for (uint8_t i = 0; i < rules.cells_pre_filled; i++) { + pile::ref r = *it; + place_card(r, deck.back()); + deck.pop_back(); + it++; + } + // If there is a stock, deals to it and set up a waste pile too if (rules.stock_size > 0) { for (unsigned int i = 0; i < rules.stock_size; i++) { diff --git a/src/main/game/sol_rules.cpp b/src/main/game/sol_rules.cpp index 55c6757..940b1a4 100644 --- a/src/main/game/sol_rules.cpp +++ b/src/main/game/sol_rules.cpp @@ -29,6 +29,7 @@ sol_rules::sol_rules() : foundations_only_comp_piles(false), diagonal_deal(false), cells(0), + cells_pre_filled(0), stock_size(0), stock_deal_t(sdt::TABLEAU_PILES), stock_deal_count(1), diff --git a/src/main/game/sol_rules.h b/src/main/game/sol_rules.h index 642e4a6..130ebcd 100644 --- a/src/main/game/sol_rules.h +++ b/src/main/game/sol_rules.h @@ -75,6 +75,7 @@ struct sol_rules { bool foundations_only_comp_piles; bool diagonal_deal; uint8_t cells; + uint8_t cells_pre_filled; uint8_t stock_size; stock_deal_type stock_deal_t; uint8_t stock_deal_count; |
