aboutsummaryrefslogtreecommitdiff
path: root/src/main/game/global_cache.h
blob: 73f0ce7ce0a30784cbf2380437e107dd05b99b3a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//
// Created by thecharlesblake on 1/10/18.
//

#ifndef SOLVITAIRE_GLOBAL_CACHE_H
#define SOLVITAIRE_GLOBAL_CACHE_H

#include <vector>
#include <unordered_set>

#include "../game/game_state.h"
#include "../game/sol_rules.h"

class global_cache {
public:
    explicit global_cache(game_state);

    bool insert(const std::vector<pile>&);
    bool contains(const std::vector<pile>&);

    friend std::size_t hash_value(card const&);
    friend std::size_t hash_value(std::vector<pile> const&);
private:
    static game_state init_gs;

    std::unordered_set<
            std::vector<pile>,
            boost::hash<std::vector<pile>>
    > u_set;
};

#endif //SOLVITAIRE_GLOBAL_CACHE_H