aboutsummaryrefslogtreecommitdiff
path: root/src/main/game/pile.cpp
diff options
context:
space:
mode:
authorCharlie Blake2018-02-02 13:04:33 +0000
committerGitHub2018-02-02 13:04:33 +0000
commit3eaf893c7edef511d5d6e7f4bbbf82fe5d1f1dce (patch)
tree2968ee1dc015a65a95d23e93afef764e88c8f36d /src/main/game/pile.cpp
parentMerge pull request #33 from thecharlesblake/fix-benchmark-bug (diff)
parentImprove printout of benchmark script (diff)
downloadmetasol-3eaf893c7edef511d5d6e7f4bbbf82fe5d1f1dce.tar.gz
metasol-3eaf893c7edef511d5d6e7f4bbbf82fe5d1f1dce.zip

Merge pull request #34 from thecharlesblake/reduced_state

Reduced state

Diffstat (limited to 'src/main/game/pile.cpp')
-rw-r--r--src/main/game/pile.cpp24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/main/game/pile.cpp b/src/main/game/pile.cpp
index 6d52335..367f7a0 100644
--- a/src/main/game/pile.cpp
+++ b/src/main/game/pile.cpp
@@ -52,17 +52,33 @@ bool operator==(const pile& a, const pile& b) {
}
bool operator<(const pile& a, const pile& b) {
- return a.pile_vec < b.pile_vec;
+ if (a.size() == b.size()) {
+ return a.pile_vec < b.pile_vec;
+ } else {
+ return a.size() < b.size();
+ }
}
bool operator>(const pile& a, const pile& b) {
- return a.pile_vec > b.pile_vec;
+ if (a.size() == b.size()) {
+ return a.pile_vec > b.pile_vec;
+ } else {
+ return a.size() > b.size();
+ }
}
bool operator<=(const pile& a, const pile& b) {
- return a.pile_vec <= b.pile_vec;
+ if (a.size() == b.size()) {
+ return a.pile_vec <= b.pile_vec;
+ } else {
+ return a.size() <= b.size();
+ }
}
bool operator>=(const pile& a, const pile& b) {
- return a.pile_vec >= b.pile_vec;
+ if (a.size() == b.size()) {
+ return a.pile_vec >= b.pile_vec;
+ } else {
+ return a.size() >= b.size();
+ }
}