aboutsummaryrefslogtreecommitdiff
path: root/src/main/game/search-state/game_state.h
diff options
context:
space:
mode:
authorCharlie Blake2018-06-10 00:28:24 +0100
committerCharlie Blake2018-06-10 00:28:24 +0100
commitf4bfb7e972fda893240899b44534c65e4a10e636 (patch)
treeb2bbe8c0aadaec16280f020e55eb55955be43d3f /src/main/game/search-state/game_state.h
parentRefactor moves logic (diff)
downloadmetasol-f4bfb7e972fda893240899b44534c65e4a10e636.tar.gz
metasol-f4bfb7e972fda893240899b44534c65e4a10e636.zip

Finish refactoring game state class

Diffstat (limited to 'src/main/game/search-state/game_state.h')
-rw-r--r--src/main/game/search-state/game_state.h30
1 files changed, 22 insertions, 8 deletions
diff --git a/src/main/game/search-state/game_state.h b/src/main/game/search-state/game_state.h
index be8b79c..7c0f9ca 100644
--- a/src/main/game/search-state/game_state.h
+++ b/src/main/game/search-state/game_state.h
@@ -70,8 +70,8 @@ private:
void make_regular_move(move move);
void undo_regular_move(move move);
- void make_built_pile_move(move move);
- void undo_built_pile_move(move move);
+ void make_built_group_move(move move);
+ void undo_built_group_move(move move);
void make_stock_to_waste_move(move move);
void undo_stock_to_waste_move(move move);
void make_stock_to_tableau_move(move move);
@@ -81,23 +81,37 @@ private:
/* Legal move generation */
+ bool stock_can_deal_tableau() const;
move get_stock_tableau_move() const;
+ bool stock_can_redeal() const;
+ bool undoes_prev_move(pile::ref, move) const;
+ bool is_foundation(pile::ref) const;
+
+ void add_stock_to_waste_move(std::vector<move>&) const;
+ void add_tableau_moves(std::vector<move>&, pile::ref) const;
+ void add_cell_moves(std::vector<move>&, pile::ref) const;
+ void add_foundation_moves(std::vector<move>&, pile::ref) const;
+ void add_built_group_moves(std::vector<move> &) const;
+ void add_foundation_complete_piles_moves(std::vector<move> &) const;
+
bool is_valid_tableau_move(pile::ref, pile::ref) const;
+ bool is_next_tableau_card(card, card) const;
bool is_valid_foundations_move(pile::ref, pile::ref) const;
bool is_valid_hole_move(pile::ref) const;
- void get_built_group_moves(std::vector<move>&) const;
+
pile::size_type get_built_group_height(pile::ref) const;
- bool valid_built_group_move(card, card, card) const;
void add_empty_built_group_moves(std::vector<move>&, pile::ref, pile::ref,
card) const;
- bool dominance_blocks_foundation_move(pile::ref);
- bool is_ordered_pile(pile::ref) const;
+ bool is_next_built_group_card(card, card) const;
+
+ bool is_next_legal_card(sol_rules::build_policy, card, card) const;
/* Auto-foundation moves */
- void update_auto_foundation_moves(pile::ref);
bool is_valid_auto_foundation_move(pile::ref) const;
-
+ bool is_ordered_pile(pile::ref) const;
+ bool dominance_blocks_foundation_move(pile::ref);
+ void update_auto_foundation_moves(pile::ref);
/* Game rules */