From add27468ed6ee09a9df6f885becc6b0428f666bf Mon Sep 17 00:00:00 2001 From: thecharlesblake Date: Fri, 12 Jan 2018 19:03:23 +0000 Subject: Implement symmetrical hash for pile vector --- src/main/game/game_state.cpp | 33 --------------------------------- 1 file changed, 33 deletions(-) (limited to 'src/main/game/game_state.cpp') 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 const& vp) { - return hash_range(begin(vp), end(vp)); -} - - /////////// // PRINT // /////////// -- cgit v1.2.1