From c987c9b501083b1995958d62c3e07fb236bc9410 Mon Sep 17 00:00:00 2001 From: Renaud G Date: Wed, 15 Apr 2020 22:42:55 +0200 Subject: Dice: fix #77 from github --- validatorlist.h | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'validatorlist.h') diff --git a/validatorlist.h b/validatorlist.h index 5d29817..1faf7e6 100644 --- a/validatorlist.h +++ b/validatorlist.h @@ -34,12 +34,27 @@ class Validator; class Die; class Result; -struct ValidatorResult +class ValidatorResult { + +public: + ValidatorResult(); + + const std::vector>& validDice() const; + std::vector>& validDiceRef(); + void setValidDice(const std::vector>& pairs); + void appendValidDice(Die* die, qint64 sum); + + void setAllTrue(bool allTrue); + bool allTrue() const; + + bool contains(Die* die); + +private: std::vector> m_validDice; - bool m_allTrue; + bool m_allTrue= false; - friend bool operator>(const ValidatorResult& a, const ValidatorResult& b) + /*friend bool operator>(const ValidatorResult& a, const ValidatorResult& b) { if(a.m_validDice.size() > b.m_validDice.size()) return true; @@ -51,7 +66,7 @@ struct ValidatorResult return false; } return false; - } + }*/ }; /** * @brief The BooleanCondition class is a Validator class checking validity from logic expression. -- cgit v1.2.3-70-g09d2