diff options
| author | Charlie Blake | 2018-07-04 14:35:42 +0100 |
|---|---|---|
| committer | Charlie Blake | 2018-07-04 14:35:42 +0100 |
| commit | 7fbc0405828a1d71b8a2ef0a14e2476adc1550cb (patch) | |
| tree | f84aa2ae3c1a2c7e141a306c85932fda2fd91355 /src/main/game/search-state/game_state.cpp | |
| parent | Add 10% timeout for str and make rerun (diff) | |
| download | metasol-7fbc0405828a1d71b8a2ef0a14e2476adc1550cb.tar.gz metasol-7fbc0405828a1d71b8a2ef0a14e2476adc1550cb.zip | |
Add variants for streamliner cmd line options
Diffstat (limited to 'src/main/game/search-state/game_state.cpp')
| -rw-r--r-- | src/main/game/search-state/game_state.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/main/game/search-state/game_state.cpp b/src/main/game/search-state/game_state.cpp index 276d582..a1d60bf 100644 --- a/src/main/game/search-state/game_state.cpp +++ b/src/main/game/search-state/game_state.cpp @@ -37,6 +37,7 @@ using std::string; typedef sol_rules::build_policy pol; typedef sol_rules::stock_deal_type sdt; typedef sol_rules::face_up_policy fu; +typedef game_state::streamliner_options sos; ////////////////// // CONSTRUCTORS // @@ -44,9 +45,9 @@ typedef sol_rules::face_up_policy fu; // A private constructor used by both of the public ones. Initializes all of the // piles and pile refs specified by the rules -game_state::game_state(const sol_rules& s_rules, bool streamliners_) +game_state::game_state(const sol_rules& s_rules, streamliner_options stream_opts_) : rules(s_rules) - , streamliners(streamliners_) + , stream_opts(stream_opts_) , stock(255) , waste(255) , hole (255) { @@ -106,14 +107,14 @@ game_state::game_state(const sol_rules& s_rules, bool streamliners_) } // Constructs an initial game state from a JSON doc -game_state::game_state(const sol_rules& s_rules, const Document& doc, bool streamliners_) - : game_state(s_rules, streamliners_) { +game_state::game_state(const sol_rules& s_rules, const Document& doc, streamliner_options s_opts) + : game_state(s_rules, s_opts) { deal_parser::parse(*this, doc); } // Constructs an initial game state from a seed -game_state::game_state(const sol_rules& s_rules, int seed, bool streamliners_) - : game_state(s_rules, streamliners_) { +game_state::game_state(const sol_rules& s_rules, int seed, streamliner_options s_opts) + : game_state(s_rules, s_opts) { vector<card> deck = gen_shuffled_deck(seed, rules.max_rank, rules.two_decks); // If there is a hole, moves the ace of spades to it @@ -198,7 +199,7 @@ game_state::game_state(const sol_rules& s_rules, int seed, bool streamliners_) game_state::game_state(const sol_rules& s_rules, std::initializer_list<std::initializer_list<string>> il) - : game_state(s_rules, false) {pile::ref pr = 0; + : game_state(s_rules, sos::NONE) {pile::ref pr = 0; for (auto& p_il : il) { for (const string& card_str : p_il) { card c(card_str.c_str(), s_rules.face_up == fu::TOP_CARDS); |
