diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/main/game/game_state.legal_moves.cpp | 7 | ||||
| -rw-r--r-- | src/main/game/sol_rules.h | 5 | ||||
| -rw-r--r-- | src/main/input-output/input/json-parsing/deal_parser.cpp | 1 | ||||
| -rw-r--r-- | src/main/input-output/input/json-parsing/rules_parser.cpp | 18 |
4 files changed, 1 insertions, 30 deletions
diff --git a/src/main/game/game_state.legal_moves.cpp b/src/main/game/game_state.legal_moves.cpp index cbc052a..5bc7762 100644 --- a/src/main/game/game_state.legal_moves.cpp +++ b/src/main/game/game_state.legal_moves.cpp @@ -6,7 +6,6 @@ using namespace std; -typedef sol_rules::build_order ord; typedef sol_rules::build_policy pol; typedef sol_rules::spaces_policy s_pol; typedef sol_rules::stock_deal_type sdt; @@ -112,11 +111,7 @@ bool game_state::is_valid_tableau_move(const pile_ref rem_ref, } // Checks rank - else if (rules.build_ord == ord::DESCENDING - && rem_c.get_rank() + 1 != add_c.get_rank()) { - return false; - } else if (rules.build_ord == ord::ASCENDING - && rem_c.get_rank() - 1 != add_c.get_rank()) { + else if (rem_c.get_rank() + 1 != add_c.get_rank()) { return false; } else { return true; diff --git a/src/main/game/sol_rules.h b/src/main/game/sol_rules.h index 87266ee..812e82c 100644 --- a/src/main/game/sol_rules.h +++ b/src/main/game/sol_rules.h @@ -13,10 +13,6 @@ struct sol_rules { // Tableau policies - enum class build_order { - DESCENDING, - ASCENDING - }; enum class build_policy { NO_BUILD, SAME_SUIT, @@ -33,7 +29,6 @@ struct sol_rules { }; uint8_t tableau_pile_count; - build_order build_ord; build_policy build_pol; spaces_policy spaces_pol; bool move_built_group; diff --git a/src/main/input-output/input/json-parsing/deal_parser.cpp b/src/main/input-output/input/json-parsing/deal_parser.cpp index 6f0694d..eb59d83 100644 --- a/src/main/input-output/input/json-parsing/deal_parser.cpp +++ b/src/main/input-output/input/json-parsing/deal_parser.cpp @@ -9,7 +9,6 @@ using namespace std; using namespace rapidjson; -typedef sol_rules::build_order ord; typedef sol_rules::build_policy pol; void deal_parser::parse(game_state &gs, const rapidjson::Document& doc) { diff --git a/src/main/input-output/input/json-parsing/rules_parser.cpp b/src/main/input-output/input/json-parsing/rules_parser.cpp index 948eb39..1893ff7 100644 --- a/src/main/input-output/input/json-parsing/rules_parser.cpp +++ b/src/main/input-output/input/json-parsing/rules_parser.cpp @@ -16,7 +16,6 @@ using namespace rapidjson; // Static // //////////// -typedef sol_rules::build_order ord; typedef sol_rules::build_policy pol; typedef sol_rules::spaces_policy s_pol; typedef sol_rules::stock_deal_type sdt; @@ -72,23 +71,6 @@ void rules_parser::modify_sol_rules(sol_rules& sr, Document& d) { } } - if (d["tableau piles"].HasMember("build order")) { - if (d["tableau piles"]["build order"].IsString()) { - string bo_str = d["tableau piles"]["build order"].GetString(); - - if (bo_str == "ascending") { - sr.build_ord = ord::ASCENDING; - } else if (bo_str == "descending") { - sr.build_ord = ord::DESCENDING; - } else { - json_helper::json_parse_err("[tableau piles][build order] is invalid"); - } - - } else { - json_helper::json_parse_err("[tableau piles][build order] must be an string"); - } - } - if (d["tableau piles"].HasMember("build policy")) { if (d["tableau piles"]["build policy"].IsString()) { string bp_str = d["tableau piles"]["build policy"].GetString(); |
