aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/game/search-state/game_state.h2
-rw-r--r--src/main/game/search-state/game_state.legal_moves.cpp16
-rw-r--r--src/test/unit_tests/k_plus_stock_test.cpp2
3 files changed, 10 insertions, 10 deletions
diff --git a/src/main/game/search-state/game_state.h b/src/main/game/search-state/game_state.h
index f6f41d9..b63823d 100644
--- a/src/main/game/search-state/game_state.h
+++ b/src/main/game/search-state/game_state.h
@@ -106,7 +106,7 @@ private:
pile::size_type get_built_group_height(pile::ref) const;
void add_empty_built_group_moves(std::vector<move>&, pile::ref, pile::ref,
- card) const;
+ card, bool) const;
bool is_next_built_group_card(card, card) const;
bool is_next_legal_card(sol_rules::build_policy, card, card) const;
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 cadeca9..be1d717 100644
--- a/src/main/game/search-state/game_state.legal_moves.cpp
+++ b/src/main/game/search-state/game_state.legal_moves.cpp
@@ -358,16 +358,17 @@ void game_state::add_built_group_moves(vector<move> &moves) const {
card bg_high = piles[rem_ref][built_group_height - 1];
+ bool is_reveal_move =
+ piles[rem_ref].size() > built_group_height
+ && piles[rem_ref][built_group_height].is_face_down();
+
if (piles[add_ref].empty()) {
if (rules.spaces_pol == s_pol::ANY)
- add_empty_built_group_moves(moves, rem_ref, add_ref, bg_high);
+ add_empty_built_group_moves(moves, rem_ref, add_ref, bg_high, is_reveal_move);
else if (rules.spaces_pol == s_pol::KINGS && bg_high.get_rank() == 13)
- moves.emplace_back(move::mtype::built_group, rem_ref, add_ref, built_group_height);
+ moves.emplace_back(move::mtype::built_group, rem_ref, add_ref, built_group_height, is_reveal_move);
} else {
if (is_next_built_group_card(piles[add_ref].top_card(), bg_high)) {
- bool is_reveal_move =
- piles[rem_ref].size() > built_group_height
- && piles[rem_ref][built_group_height].is_face_down();
moves.emplace_back(move::mtype::built_group, rem_ref, add_ref, built_group_height, is_reveal_move);
}
}
@@ -387,10 +388,11 @@ pile::size_type game_state::get_built_group_height(pile::ref ref) const {
// Loops through each possible built group move to an empty pile and adds it to the list
void game_state::add_empty_built_group_moves(vector<move>& moves, pile::ref rem_ref, pile::ref add_ref,
- card bg_high) const {
+ card bg_high, bool is_reveal_move) const {
pile::size_type card_idx = 1;
do {
- moves.emplace_back(move::mtype::built_group, rem_ref, add_ref, static_cast<pile::size_type>(card_idx + 1));
+ moves.emplace_back(move::mtype::built_group, rem_ref, add_ref, static_cast<pile::size_type>(card_idx + 1),
+ is_reveal_move);
} while (piles[rem_ref][card_idx++] != bg_high);
if (card_idx < piles[rem_ref].size() && piles[rem_ref][card_idx].is_face_down())
diff --git a/src/test/unit_tests/k_plus_stock_test.cpp b/src/test/unit_tests/k_plus_stock_test.cpp
index f56373e..ea993e3 100644
--- a/src/test/unit_tests/k_plus_stock_test.cpp
+++ b/src/test/unit_tests/k_plus_stock_test.cpp
@@ -365,5 +365,3 @@ TEST(KPlusStock, RedealCellFoundationMoves) {
"2H", "2C"
);
}
-
-// TODO: add to logic if !redeal && !piles[waste].empty(), consider top waste card too ===>>> FOR ALL 3 WASTE/STOCK MOVE TYPES