aboutsummaryrefslogtreecommitdiff
path: root/src/main/game/card.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/game/card.h')
-rw-r--r--src/main/game/card.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main/game/card.h b/src/main/game/card.h
index cc5a993..4cab774 100644
--- a/src/main/game/card.h
+++ b/src/main/game/card.h
@@ -10,14 +10,18 @@
class card {
public:
+ // Types & typedefs
enum class suit_t {Clubs, Diamonds, Hearts, Spades};
enum class colour_t {Black, Red};
typedef uint8_t rank_t;
+ // Converts a number (0-3) to a suit (Clubs-Spades)
+ static suit_t to_suit(uint8_t);
+
// A card can either be created using two int values (rank & suit), or
// using a string (e.g. "AS")
card(suit_t, rank_t);
- card(const char*);
+ explicit card(const char*);
suit_t get_suit() const;
colour_t get_colour() const;
@@ -31,8 +35,8 @@ private:
rank_t rank : 4;
};
-std::ostream & operator<<(std::ostream &, card const &);
bool operator==(const card&, const card&);
+bool operator!=(const card&, const card&);
std::size_t hash_value(card const&);