diff options
| -rw-r--r-- | src/main/game/search-state/game_state.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/main/game/search-state/game_state.cpp b/src/main/game/search-state/game_state.cpp index 1af554c..fdfb1ce 100644 --- a/src/main/game/search-state/game_state.cpp +++ b/src/main/game/search-state/game_state.cpp @@ -195,6 +195,21 @@ game_state::game_state(const sol_rules& s_rules, int seed, streamliner_options s if (!p.empty()) p[0].turn_face_up(); + // Deals to the sequence piles + if (rules.sequence_count > 0) { + for (int t = 0; !deck.empty(); t++) { + card c = deck.back(); + if (c.get_rank() == 1) c = card(); // Inserts gaps where aces would be + + // Adds the randomly generated card to the tableau piles + auto s = t % sequences.size(); + + pile::ref seq_pile = sequences[s]; + place_card(seq_pile, c); + deck.pop_back(); + } + } + // The size of all piles must equal the deck size int piles_sz = 0; for (auto& p : piles) piles_sz += p.size(); |
