aboutsummaryrefslogtreecommitdiff
path: root/src/main/game/game_state.h
diff options
context:
space:
mode:
authorthecharlesblake2018-01-25 15:20:54 +0000
committerthecharlesblake2018-01-25 15:20:54 +0000
commit252c7398925b5267963c1a48251cd7ba2d4ec381 (patch)
tree48edb3c44e1a7e8e6008dc764ae960273d466427 /src/main/game/game_state.h
parentMerge pull request #31 from thecharlesblake/profiling-fix (diff)
downloadmetasol-252c7398925b5267963c1a48251cd7ba2d4ec381.tar.gz
metasol-252c7398925b5267963c1a48251cd7ba2d4ec381.zip

Refactor game_state & cache to remove static hack

Diffstat (limited to 'src/main/game/game_state.h')
-rw-r--r--src/main/game/game_state.h23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/main/game/game_state.h b/src/main/game/game_state.h
index 8dcffa4..8434bf7 100644
--- a/src/main/game/game_state.h
+++ b/src/main/game/game_state.h
@@ -18,7 +18,8 @@
class game_state {
friend class deal_parser;
friend class state_printer;
- friend class game_state_pred;
+ friend class predicate;
+ friend class hasher;
public:
// Defines types
typedef uint8_t pile_ref;
@@ -48,11 +49,7 @@ public:
friend std::ostream& operator<< (std::ostream&, const game_state&);
- friend std::size_t hash_value(card const&);
- friend std::size_t hash_value(game_state const&);
-
private:
- void static_reset();
static std::vector<card> gen_shuffled_deck(int, card::rank_t, bool);
// Private constructor
@@ -71,14 +68,14 @@ private:
card) const;
// References to piles
- static sol_rules rules;
- static std::vector<pile_ref> tableau_piles;
- static std::vector<pile_ref> cells;
- static pile_ref stock;
- static pile_ref waste;
- static std::vector<pile_ref> reserve;
- static std::vector<pile_ref> foundations;
- static pile_ref hole;
+ const sol_rules rules;
+ std::vector<pile_ref> tableau_piles;
+ std::vector<pile_ref> cells;
+ pile_ref stock;
+ pile_ref waste;
+ std::vector<pile_ref> reserve;
+ std::vector<pile_ref> foundations;
+ pile_ref hole;
// The core piles
std::vector<pile> piles;