From 653ba9395a36cc20ec1d68c9a9cae78973fa334c Mon Sep 17 00:00:00 2001 From: Renaud G Date: Thu, 30 Jan 2020 01:27:15 +0100 Subject: add unicity and repeat function part2 --- node/ifnode.h | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) (limited to 'node/ifnode.h') diff --git a/node/ifnode.h b/node/ifnode.h index 55a6051..f0046f0 100644 --- a/node/ifnode.h +++ b/node/ifnode.h @@ -20,10 +20,11 @@ #ifndef IFNODE_H #define IFNODE_H +#include "diceparserhelper.h" #include "executionnode.h" #include "result/diceresult.h" -#include "validator.h" -#include + +class ValidatorList; class PartialDiceRollNode : public ExecutionNode { public: @@ -45,16 +46,6 @@ private: class IfNode : public ExecutionNode { public: - /** - * @brief The ConditionType enum - */ - enum ConditionType - { - OnEach, - OneOfThem, - AllOfThem, - OnScalar - }; /** * @brief IfNode */ @@ -71,7 +62,7 @@ public: /** * @brief setValidator */ - virtual void setValidator(Validator*); + virtual void setValidatorList(ValidatorList*); /** * @brief setInstructionTrue */ @@ -105,20 +96,20 @@ public: * @brief getConditionType * @return */ - ConditionType getConditionType() const; + Dice::ConditionType getConditionType() const; /** * @brief setConditionType * @param conditionType */ - void setConditionType(const IfNode::ConditionType& conditionType); + void setConditionType(const Dice::ConditionType& conditionType); protected: ExecutionNode* getLeafNode(ExecutionNode* node); protected: - Validator* m_validator; - ConditionType m_conditionType; + ValidatorList* m_validatorList= nullptr; + Dice::ConditionType m_conditionType; ExecutionNode* m_true; ExecutionNode* m_false; -- cgit v1.2.3-70-g09d2