aboutsummaryrefslogtreecommitdiff
path: root/src/main/game/global_cache.h
diff options
context:
space:
mode:
authorthecharlesblake2018-01-30 15:48:53 +0000
committerthecharlesblake2018-01-30 15:48:53 +0000
commit27d9dff6f3df31395f7d30aeeca121d0bfcfd30c (patch)
tree38e76e5d609761cde5b7684634dad6937a60da21 /src/main/game/global_cache.h
parentUpdate game_state so comm piles always ordered (diff)
downloadmetasol-27d9dff6f3df31395f7d30aeeca121d0bfcfd30c.tar.gz
metasol-27d9dff6f3df31395f7d30aeeca121d0bfcfd30c.zip

Update global cache to insert ordered vec

Diffstat (limited to 'src/main/game/global_cache.h')
-rw-r--r--src/main/game/global_cache.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/main/game/global_cache.h b/src/main/game/global_cache.h
index 0e8fe0c..2d99275 100644
--- a/src/main/game/global_cache.h
+++ b/src/main/game/global_cache.h
@@ -13,8 +13,7 @@
class predicate {
public:
- explicit predicate(const game_state&);
- static bool comp_pile(const pile&, const pile&);
+ predicate(const game_state&);
bool operator() (const std::vector<pile>&, const std::vector<pile>&) const;
private:
const game_state& init_gs;
@@ -32,12 +31,16 @@ struct hasher {
const game_state& init_gs;
};
-struct global_cache {
+class global_cache {
+public:
explicit global_cache(const game_state&);
- bool insert(const std::vector<pile>&);
- bool contains(const std::vector<pile>&) const;
+ bool insert(const game_state&);
+ bool contains(const game_state&) const;
void clear();
+private:
+ static std::vector<pile> get_ordered_vec(const game_state&);
+
std::unordered_set<
std::vector<pile>,
hasher,