From 6fcb78852cfda18f83877636278fbb903a0d9b9a Mon Sep 17 00:00:00 2001 From: Renaud G Date: Sun, 28 Jul 2019 01:47:08 +0200 Subject: new api for validator --- validator.cpp | 5 +++++ validator.h | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/validator.cpp b/validator.cpp index aba97c6..9f717f8 100644 --- a/validator.cpp +++ b/validator.cpp @@ -23,3 +23,8 @@ Validator::Validator() {} Validator::~Validator() {} + +const std::set& Validator::getPossibleValues(const std::pair&) +{ + return m_values; +} diff --git a/validator.h b/validator.h index 469a6fe..a1e7d65 100644 --- a/validator.h +++ b/validator.h @@ -22,9 +22,11 @@ #ifndef VALIDATOR_H #define VALIDATOR_H +#include "diceparserhelper.h" #include "die.h" #include #include +#include /** * @brief The Validator class is an abstract class for checking the validity of dice for some * operator. @@ -58,12 +60,17 @@ public: * @param faces * @return */ - virtual bool isValidRangeSize(std::pair range) const= 0; + virtual Dice::CONDITION_STATE isValidRangeSize(const std::pair& range) const= 0; /** * @brief getCopy * @return return a copy of this validator */ virtual Validator* getCopy() const= 0; + + virtual const std::set& getPossibleValues(const std::pair& range); + +protected: + std::set m_values; }; #endif // VALIDATOR_H -- cgit v1.2.3-70-g09d2