diff options
| author | thecharlesblake | 2018-01-12 19:03:23 +0000 |
|---|---|---|
| committer | thecharlesblake | 2018-01-12 19:03:23 +0000 |
| commit | add27468ed6ee09a9df6f885becc6b0428f666bf (patch) | |
| tree | 18c0f37f59fdb724de61fdf5ca51f4e07abb5c44 /src/main/game/game_state.cpp | |
| parent | Implement hash for piles (diff) | |
| download | metasol-add27468ed6ee09a9df6f885becc6b0428f666bf.tar.gz metasol-add27468ed6ee09a9df6f885becc6b0428f666bf.zip | |
Implement symmetrical hash for pile vector
Diffstat (limited to 'src/main/game/game_state.cpp')
| -rw-r--r-- | src/main/game/game_state.cpp | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/src/main/game/game_state.cpp b/src/main/game/game_state.cpp index f8f9e1e..e2bfc24 100644 --- a/src/main/game/game_state.cpp +++ b/src/main/game/game_state.cpp @@ -317,39 +317,6 @@ bool operator==(const game_state& a, const game_state& b) { } -//////////////////// -// HASH FUNCTIONS // -//////////////////// - -size_t hash_value(game_state const& gs) { - size_t seed = 0; - - if (gs.rules.foundations) { - hash_combine(seed, gs.foundations); - } - if (gs.rules.cells) { - hash_combine(seed, gs.cells); - } - if (gs.rules.tableau_pile_count > 0) { - hash_combine(seed, gs.tableau_piles); - } - - if (gs.rules.stock_size > 0) { - hash_combine(seed, gs.piles[gs.stock]); - hash_combine(seed, gs.piles[gs.waste]); - } - if (gs.rules.hole) { - hash_combine(seed, gs.piles[gs.hole]); - } - - return seed; -} - -size_t hash_value(vector<pile> const& vp) { - return hash_range(begin(vp), end(vp)); -} - - /////////// // PRINT // /////////// |
