From 2b92783762c2824e519b881afbf5d66a606c394f Mon Sep 17 00:00:00 2001 From: Charlie Blake Date: Mon, 25 Jun 2018 11:50:34 +0100 Subject: Add card face down unit tests --- src/main/game/card.cpp | 10 ++++++++++ src/main/game/card.h | 4 ++++ src/main/game/sol_rules.h | 6 ++++++ 3 files changed, 20 insertions(+) (limited to 'src/main') diff --git a/src/main/game/card.cpp b/src/main/game/card.cpp index cfb94a9..710b394 100644 --- a/src/main/game/card.cpp +++ b/src/main/game/card.cpp @@ -85,6 +85,16 @@ std::string card::to_string() const { return s; } +bool card::is_face_up() const { + return true; +} + +void card::turn_face_up() { +} + +void card::turn_face_down() { +} + const card card::divider = card(0, 0); bool operator==(const card& l, const card& r) { diff --git a/src/main/game/card.h b/src/main/game/card.h index a4c6b1e..ad14d2b 100644 --- a/src/main/game/card.h +++ b/src/main/game/card.h @@ -39,6 +39,10 @@ public: colour_t get_colour() const; rank_t get_rank() const; + bool is_face_up() const; + void turn_face_up(); + void turn_face_down(); + std::string to_string() const; private: diff --git a/src/main/game/sol_rules.h b/src/main/game/sol_rules.h index adab00d..a7b9ae6 100644 --- a/src/main/game/sol_rules.h +++ b/src/main/game/sol_rules.h @@ -28,6 +28,10 @@ struct sol_rules { WASTE, TABLEAU_PILES }; + enum class face_up_policy { + ALL, + TOP_CARDS + }; uint8_t tableau_pile_count; build_policy build_pol; @@ -49,6 +53,8 @@ struct sol_rules { bool stock_redeal; uint8_t reserve_size; bool reserve_stacked; + face_up_policy face_up; + }; #endif //SOLVITAIRE_SOL_RULES_H -- cgit v1.2.1