diff options
| author | Charlie Blake | 2018-01-30 19:51:38 +0000 |
|---|---|---|
| committer | GitHub | 2018-01-30 19:51:38 +0000 |
| commit | 2fc005bdbb4707810ad0ae36a6863e70f0ff91b5 (patch) | |
| tree | 59ca3063ffe6a876d27c96ea95d6a3683273675a /src/main/game/pile.cpp | |
| parent | Merge pull request #31 from thecharlesblake/profiling-fix (diff) | |
| parent | Add ORDER_ON_CACHE to benchmark script (diff) | |
| download | metasol-2fc005bdbb4707810ad0ae36a6863e70f0ff91b5.tar.gz metasol-2fc005bdbb4707810ad0ae36a6863e70f0ff91b5.zip | |
Merge pull request #32 from thecharlesblake/piles-always-sorted
Piles always sorted
Diffstat (limited to 'src/main/game/pile.cpp')
| -rw-r--r-- | src/main/game/pile.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/main/game/pile.cpp b/src/main/game/pile.cpp index 21eddc0..6d52335 100644 --- a/src/main/game/pile.cpp +++ b/src/main/game/pile.cpp @@ -50,3 +50,19 @@ card pile::take() { bool operator==(const pile& a, const pile& b) { return a.pile_vec == b.pile_vec; } + +bool operator<(const pile& a, const pile& b) { + return a.pile_vec < b.pile_vec; +} + +bool operator>(const pile& a, const pile& b) { + return a.pile_vec > b.pile_vec; +} + +bool operator<=(const pile& a, const pile& b) { + return a.pile_vec <= b.pile_vec; +} + +bool operator>=(const pile& a, const pile& b) { + return a.pile_vec >= b.pile_vec; +} |
