From 9ea820ab371c7e1c033ab912317ba6096db87caa Mon Sep 17 00:00:00 2001 From: thecharlesblake Date: Fri, 12 Jan 2018 16:31:38 +0000 Subject: Add unit tests for global cache --- src/main/game/pile.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/main/game/pile.h') diff --git a/src/main/game/pile.h b/src/main/game/pile.h index f2600fe..fb7bc38 100644 --- a/src/main/game/pile.h +++ b/src/main/game/pile.h @@ -13,6 +13,7 @@ class pile { public: + pile(std::vector); typedef uint8_t size_type; // Inspect -- cgit v1.2.1 From 895bbca6c0c7233fe11f331a10135443970ec4c5 Mon Sep 17 00:00:00 2001 From: thecharlesblake Date: Fri, 12 Jan 2018 18:05:07 +0000 Subject: Implement hash for piles --- src/main/game/pile.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/main/game/pile.h') diff --git a/src/main/game/pile.h b/src/main/game/pile.h index fb7bc38..ab661ca 100644 --- a/src/main/game/pile.h +++ b/src/main/game/pile.h @@ -29,6 +29,8 @@ public: card& operator[] (size_type); card operator[] (size_type) const; + + friend bool operator==(const pile&, const pile&); friend std::size_t hash_value(pile const&); private: -- cgit v1.2.1 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/pile.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/main/game/pile.h') diff --git a/src/main/game/pile.h b/src/main/game/pile.h index ab661ca..fb7bc38 100644 --- a/src/main/game/pile.h +++ b/src/main/game/pile.h @@ -29,8 +29,6 @@ public: card& operator[] (size_type); card operator[] (size_type) const; - - friend bool operator==(const pile&, const pile&); friend std::size_t hash_value(pile const&); private: -- cgit v1.2.1 From 1f078952baf3cc8512b709e345a622add91a667b Mon Sep 17 00:00:00 2001 From: thecharlesblake Date: Thu, 18 Jan 2018 13:49:10 +0000 Subject: Add vector and initializer lst constructor to pile --- src/main/game/pile.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/main/game/pile.h') diff --git a/src/main/game/pile.h b/src/main/game/pile.h index fb7bc38..411f890 100644 --- a/src/main/game/pile.h +++ b/src/main/game/pile.h @@ -13,9 +13,12 @@ class pile { public: - pile(std::vector); typedef uint8_t size_type; + pile() = default; + pile(std::vector); + pile(std::initializer_list); + // Inspect card top_card() const; bool empty() const; -- cgit v1.2.1