aboutsummaryrefslogtreecommitdiff
path: root/src/main/game/pile.cpp
diff options
context:
space:
mode:
authorCharlie Blake2017-12-25 22:39:46 +0000
committerGitHub2017-12-25 22:39:46 +0000
commit846b3d141352a492a5b8e0f61a2707b8feacbcc6 (patch)
tree3e10925da099bac8deb71e90d111fad2cd7abb2b /src/main/game/pile.cpp
parentMerge pull request #23 from thecharlesblake/benchmark-script (diff)
parentAdd necessary features for profiler (diff)
downloadmetasol-846b3d141352a492a5b8e0f61a2707b8feacbcc6.tar.gz
metasol-846b3d141352a492a5b8e0f61a2707b8feacbcc6.zip

Merge pull request #24 from thecharlesblake/basic-optimisations

Basic optimisations

Diffstat (limited to 'src/main/game/pile.cpp')
-rw-r--r--src/main/game/pile.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main/game/pile.cpp b/src/main/game/pile.cpp
index bebd1f6..1ce7c01 100644
--- a/src/main/game/pile.cpp
+++ b/src/main/game/pile.cpp
@@ -5,9 +5,12 @@
#include <vector>
#include <ostream>
+#include <boost/functional/hash.hpp>
+
#include "pile.h"
using namespace std;
+using namespace boost;
typedef sol_rules::build_order ord;
typedef sol_rules::build_policy pol;
@@ -143,3 +146,7 @@ void pile::clear() {
bool operator==(const pile& a, const pile& b) {
return a.pile_vec == b.pile_vec;
}
+
+size_t hash_value(pile const& p) {
+ return hash_range(begin(p.pile_vec), end(p.pile_vec));
+}