From f92c4ef763bbd3e0d8dc1145121e3af5d3ea16cf Mon Sep 17 00:00:00 2001 From: thecharlesblake Date: Sun, 14 Oct 2018 13:08:51 +0100 Subject: Add pre-filled cells --- src/main/game/search-state/game_state.cpp | 9 +++++++++ src/main/game/sol_rules.cpp | 1 + src/main/game/sol_rules.h | 1 + 3 files changed, 11 insertions(+) (limited to 'src/main/game') 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; -- cgit v1.2.1