From 4de8cf5796446b7f8b09d776e4a6a6d6b8e95cb6 Mon Sep 17 00:00:00 2001 From: Renaud G Date: Sat, 4 Jan 2014 16:24:54 +0100 Subject: -Adding range, booleancondition and countexecutenode. --- diceparser.h | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) (limited to 'diceparser.h') diff --git a/diceparser.h b/diceparser.h index 6833a92..1615aaf 100644 --- a/diceparser.h +++ b/diceparser.h @@ -4,6 +4,9 @@ #include #include #include "node/executionnode.h" +#include "validator.h" +#include "range.h" +#include "booleancondition.h" /** * @mainpage DiceParser @@ -28,13 +31,16 @@ class DiceParser public: /** - * @brief The DiceOperator enum gathering all dice operator + * @brief The DiceOperator enum gathering all dice operators */ enum DiceOperator {D}; + + + /** - * @brief The MathOperator enum gathering all dice option/math operator such as keep k, reroll r, explode e. + * @brief The OptionOperator enum gathering all options availables for result. */ - enum MathOperator {K,k,r,e}; + enum OptionOperator {KeepAndReRoll,keep,Reroll,Explosing,Sort,Count}; /** * @brief DiceParser default constructor @@ -83,8 +89,32 @@ private: */ void setCurrentNode(ExecutionNode* node); + /** + * @brief readOption + */ + bool readOption(QString&); + + /** + * @brief addSort + * @param b + */ + void addSort(bool b); + + /** + * @brief readValidator + * @param str + * @param validator + * @return + */ + Validator* readValidator(QString& str); + + + bool readLogicOperator(QString& str,BooleanCondition::LogicOperator& condition); + private: QMap* m_mapDiceOp; + QMap* m_OptionOp; + QMap* m_logicOp; ExecutionNode* m_start; ExecutionNode* m_current; }; -- cgit v1.2.3-70-g09d2