diff options
Diffstat (limited to 'src/main')
| -rw-r--r-- | src/main/game/pile.cpp | 24 | ||||
| -rw-r--r-- | src/main/game/pile.h | 1 |
2 files changed, 21 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(); + } } diff --git a/src/main/game/pile.h b/src/main/game/pile.h index 4256b02..7257738 100644 --- a/src/main/game/pile.h +++ b/src/main/game/pile.h @@ -14,6 +14,7 @@ class pile { friend class hasher; friend class game_state; + friend class cached_game_state; public: typedef uint8_t size_type; |
