aboutsummaryrefslogtreecommitdiff
path: root/src/main/game/global_cache.cpp
diff options
context:
space:
mode:
authorCharlie Blake2018-07-04 14:36:36 +0100
committerGitHub2018-07-04 14:36:36 +0100
commit0edeee6a85e7bf650652e8a07353d46e4de92d13 (patch)
treef84aa2ae3c1a2c7e141a306c85932fda2fd91355 /src/main/game/global_cache.cpp
parentMerge pull request #73 from thecharlesblake/fix-legal-move-bugs (diff)
parentAdd variants for streamliner cmd line options (diff)
downloadmetasol-0edeee6a85e7bf650652e8a07353d46e4de92d13.tar.gz
metasol-0edeee6a85e7bf650652e8a07353d46e4de92d13.zip

Merge pull request #74 from thecharlesblake/sol-streamliner-variants

Sol streamliner variants

Diffstat (limited to 'src/main/game/global_cache.cpp')
-rw-r--r--src/main/game/global_cache.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main/game/global_cache.cpp b/src/main/game/global_cache.cpp
index 2cec338..ee2a2b8 100644
--- a/src/main/game/global_cache.cpp
+++ b/src/main/game/global_cache.cpp
@@ -8,12 +8,14 @@
#include "global_cache.h"
#include "../input-output/output/log_helper.h"
+#include "search-state/game_state.h"
using namespace std;
using namespace boost;
typedef sol_rules::build_policy pol;
typedef sol_rules::stock_deal_type sdt;
+typedef game_state::streamliner_options sos;
typedef boost::multi_index::multi_index_container<
cached_game_state,
@@ -81,7 +83,9 @@ void cached_game_state::add_card(card c, const game_state& gs) {
// If the game is a 'hole-based' game, or suit-reduction is on, reduces
// the cached suit of the card where possible
- bool is_suit_symmetry = gs.streamliners || gs.rules.hole;
+ bool is_suit_symmetry = gs.stream_opts == sos::SUIT_SYMMETRY
+ || gs.stream_opts == sos::BOTH
+ || gs.rules.hole;
if (is_suit_symmetry) {
switch (gs.rules.build_pol) {
@@ -135,7 +139,9 @@ size_t hasher::hash_value(card const& c) const {
// If the game is a 'hole-based' game, or suit-reduction is enabled, hash
// the reduced suit
- bool is_suit_symmetry = init_gs.streamliners || init_gs.rules.hole;
+ bool is_suit_symmetry = init_gs.stream_opts == sos::SUIT_SYMMETRY
+ || init_gs.stream_opts == sos::BOTH
+ || init_gs.rules.hole;
uint8_t suit_val;
if (is_suit_symmetry) {