diff options
| author | 2014-01-04 16:24:54 +0100 | |
|---|---|---|
| committer | 2014-01-04 16:24:54 +0100 | |
| commit | 4de8cf5796446b7f8b09d776e4a6a6d6b8e95cb6 (patch) | |
| tree | d0553a394e50d1de1a5185a7006fe3cb66cbfa3b /diceparser.h | |
| parent | 4114232457cbc5739872f479ef5d7772e6b5f42f (diff) | |
| download | OneRoll-4de8cf5796446b7f8b09d776e4a6a6d6b8e95cb6.tar.gz OneRoll-4de8cf5796446b7f8b09d776e4a6a6d6b8e95cb6.zip | |
-Adding range, booleancondition and countexecutenode.
Diffstat (limited to 'diceparser.h')
| -rw-r--r-- | diceparser.h | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/diceparser.h b/diceparser.h index 6833a92..1615aaf 100644 --- a/diceparser.h +++ b/diceparser.h @@ -4,6 +4,9 @@ #include <QString> #include <QMap> #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<QString,DiceOperator>* m_mapDiceOp; + QMap<QString,OptionOperator>* m_OptionOp; + QMap<QString,BooleanCondition::LogicOperator>* m_logicOp; ExecutionNode* m_start; ExecutionNode* m_current; }; |