diff options
| author | Charlie Blake | 2018-07-03 14:49:25 +0100 |
|---|---|---|
| committer | Charlie Blake | 2018-07-03 14:49:25 +0100 |
| commit | 9114b8032cadd17553a07daef49e2272aa4116e9 (patch) | |
| tree | e220211c8313be2b25f1aebf537ffbf4a352f1db /src | |
| parent | Fix klondike bugs (diff) | |
| download | metasol-9114b8032cadd17553a07daef49e2272aa4116e9.tar.gz metasol-9114b8032cadd17553a07daef49e2272aa4116e9.zip | |
Tidy up stock rep and amend broken unit tests
Diffstat (limited to 'src')
| -rw-r--r-- | src/main/game/search-state/game_state.legal_moves.cpp | 42 | ||||
| -rw-r--r-- | src/main/input-output/input/sol_preset_types.cpp | 3 | ||||
| -rw-r--r-- | src/test/unit_tests/k_plus_stock_test.cpp | 6 |
3 files changed, 6 insertions, 45 deletions
diff --git a/src/main/game/search-state/game_state.legal_moves.cpp b/src/main/game/search-state/game_state.legal_moves.cpp index 42ba578..5dfa00a 100644 --- a/src/main/game/search-state/game_state.legal_moves.cpp +++ b/src/main/game/search-state/game_state.legal_moves.cpp @@ -21,11 +21,6 @@ typedef sol_rules::spaces_policy s_pol; typedef sol_rules::stock_deal_type sdt; typedef sol_rules::face_up_policy fu; -// TODO: delete -using std::ostream; -std::ostream& operator <<(std::ostream&, const move&); -std::ostream& operator <<(std::ostream&, const std::vector<move>&); - //////////////////////////////// // MAIN LEGAL MOVE GEN CYCLE /// //////////////////////////////// @@ -145,46 +140,9 @@ vector<move> game_state::get_legal_moves(move parent_move) { if (rules.tableau_pile_count > 0 && rules.face_up != fu::ALL) turn_face_down_cards(moves); - // TODO: delete -//#ifndef NDEBUG -// std::cerr << "Moves:\n" << moves; - /*vector<move>::size_type i = 0; - std::cin >> i; - move m = moves[i]; - moves.erase(moves.begin() + i); - moves.push_back(m);*/ -//#endif - return moves; } -/*#ifndef NDEBUG -// TODO: delete -ostream& operator <<(ostream& os, const move& m) { - switch (m.type) { - case move::mtype::regular: os << "regular"; break; - case move::mtype::dominance: os << "dominance"; break; - case move::mtype::built_group: os << "built_group"; break; - case move::mtype::stock_k_plus: os << "stock_k_plus"; break; - case move::mtype::stock_to_all_tableau: os << "stock_to_all_tableau"; break; - case move::mtype::null: os << "null"; break; - } - os << " (" << int(m.from) - << "," << int(m.to) - << "," << int(m.count) - << "," << m.reveal_move - << ")"; - return os; -} -ostream& operator <<(ostream& os, const vector<move>& moves) { - int i = 0; - for (const move m : moves) { - os << m << " "<< i++ << "\n"; - } - return os; -} -#endif*/ - //////////////////////////////// // REGULAR MOVE GEN FUNCTIONS // diff --git a/src/main/input-output/input/sol_preset_types.cpp b/src/main/input-output/input/sol_preset_types.cpp index ee19b5c..e540a51 100644 --- a/src/main/input-output/input/sol_preset_types.cpp +++ b/src/main/input-output/input/sol_preset_types.cpp @@ -816,7 +816,8 @@ map<string, string> sol_preset_types::mp = { "tableau piles": { "count": 7, "build policy": "red-black", - "move built group": true + "move built group": true, + "face up cards": "top" }, "foundations removable": true, "stock size": 31, diff --git a/src/test/unit_tests/k_plus_stock_test.cpp b/src/test/unit_tests/k_plus_stock_test.cpp index ea993e3..1507f1d 100644 --- a/src/test/unit_tests/k_plus_stock_test.cpp +++ b/src/test/unit_tests/k_plus_stock_test.cpp @@ -202,7 +202,8 @@ TEST(KPlusStock, RedealKPlus3Waste) { }, { move(move::mtype::stock_k_plus, 0, 3, 5), - move(move::mtype::stock_k_plus, 0, 4, 8) + move(move::mtype::stock_k_plus, 0, 4, 8), + move(move::mtype::regular, 1, 4, 1) }, move(move::mtype::stock_k_plus, 0, 4, 8), 6, 2, @@ -288,7 +289,8 @@ TEST(KPlusStock, RedealKPlusEmptyStock) { }, { move(move::mtype::stock_k_plus, 0, 3, 5), - move(move::mtype::stock_k_plus, 0, 4, 8) + move(move::mtype::stock_k_plus, 0, 4, 8), + move(move::mtype::regular, 1, 4, 1) }, move(move::mtype::stock_k_plus, 0, 3, 5), 8, 0, |
