diff options
| author | 2020-04-15 22:42:55 +0200 | |
|---|---|---|
| committer | 2020-04-15 22:42:55 +0200 | |
| commit | c987c9b501083b1995958d62c3e07fb236bc9410 (patch) | |
| tree | 5a88935be195e39522d9e3f4336d314b7cbf0bb8 /validatorlist.h | |
| parent | c4ae3b2555fad261b21b285a0845238ad3b7e3e5 (diff) | |
| download | OneRoll-c987c9b501083b1995958d62c3e07fb236bc9410.tar.gz OneRoll-c987c9b501083b1995958d62c3e07fb236bc9410.zip | |
Dice: fix #77 from github
Diffstat (limited to 'validatorlist.h')
| -rw-r--r-- | validatorlist.h | 23 |
1 files changed, 19 insertions, 4 deletions
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<std::pair<Die*, qint64>>& validDice() const; + std::vector<std::pair<Die*, qint64>>& validDiceRef(); + void setValidDice(const std::vector<std::pair<Die*, qint64>>& pairs); + void appendValidDice(Die* die, qint64 sum); + + void setAllTrue(bool allTrue); + bool allTrue() const; + + bool contains(Die* die); + +private: std::vector<std::pair<Die*, qint64>> 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. |