From c0c6378cb05de97ecc1ff0be4e66624e6a9bdb3b Mon Sep 17 00:00:00 2001 From: Renaud Guezennec Date: Tue, 28 Nov 2017 15:48:18 +0100 Subject: -Better indentation --- diceparser.h | 28 ++++++++++++++-------------- node/executionnode.cpp | 20 ++++++++++---------- node/executionnode.h | 27 +++++++++++++++------------ 3 files changed, 39 insertions(+), 36 deletions(-) diff --git a/diceparser.h b/diceparser.h index 9b00d72..6c9915d 100644 --- a/diceparser.h +++ b/diceparser.h @@ -91,10 +91,10 @@ public: * @brief DiceParser default constructor */ DiceParser(); - /** - * @brief ~DiceParser - */ - virtual ~DiceParser(); + /** + * @brief ~DiceParser + */ + virtual ~DiceParser(); /** * @brief parseLine, method to call for starting the dice roll. It will parse the command and run the execution tree. @@ -273,11 +273,11 @@ private: */ bool readOption(QString&,ExecutionNode* node);//OptionOperator& option, - /** - * @brief addRollDiceNode - * @param faces - * @return - */ + /** + * @brief addRollDiceNode + * @param faces + * @return + */ DiceRollerNode* addRollDiceNode(qint64 faces,ExecutionNode*); /** * @brief addExploseDiceNode @@ -286,11 +286,11 @@ private: * @return */ ExploseDiceNode* addExploseDiceNode(qint64 faces,ExecutionNode* previous); - /** - * @brief readOperand - * @param node - * @return - */ + /** + * @brief readOperand + * @param node + * @return + */ bool readOperand(QString&,ExecutionNode* & node); /** diff --git a/node/executionnode.cpp b/node/executionnode.cpp index 84aa17c..73272b4 100644 --- a/node/executionnode.cpp +++ b/node/executionnode.cpp @@ -9,16 +9,16 @@ ExecutionNode::ExecutionNode() } ExecutionNode::~ExecutionNode() { - if(nullptr!=m_result) - { - delete m_result; - m_result = nullptr; - } - if(nullptr!=m_nextNode) - { - delete m_nextNode; - m_nextNode = nullptr; - } + if(nullptr!=m_result) + { + delete m_result; + m_result = nullptr; + } + if(nullptr!=m_nextNode) + { + delete m_nextNode; + m_nextNode = nullptr; + } } Result* ExecutionNode::getResult() diff --git a/node/executionnode.h b/node/executionnode.h index 4913b68..6fe8c62 100644 --- a/node/executionnode.h +++ b/node/executionnode.h @@ -10,7 +10,10 @@ class ExecutionNode { public: - enum DICE_ERROR_CODE {NO_DICE_ERROR,DIE_RESULT_EXPECTED,BAD_SYNTAXE,ENDLESS_LOOP_ERROR,DIVIDE_BY_ZERO,NOTHING_UNDERSTOOD,NO_DICE_TO_ROLL,TOO_MANY_DICE}; + enum DICE_ERROR_CODE {NO_DICE_ERROR,DIE_RESULT_EXPECTED,BAD_SYNTAXE, + ENDLESS_LOOP_ERROR,DIVIDE_BY_ZERO,NOTHING_UNDERSTOOD, + NO_DICE_TO_ROLL,TOO_MANY_DICE,NO_VARIBALE, + INVALID_INDEX}; /** * @brief ExecutionNode */ @@ -28,7 +31,7 @@ public: * @brief getResult * @return */ - virtual Result* getResult(); + virtual Result* getResult(); /** * @brief setNextNode */ @@ -38,11 +41,11 @@ public: * @return */ ExecutionNode* getNextNode(); - /** - * @brief getPreviousNode - * @return - */ - virtual ExecutionNode* getPreviousNode() const; + /** + * @brief getPreviousNode + * @return + */ + virtual ExecutionNode* getPreviousNode() const; void setPreviousNode(ExecutionNode* node); /** * @brief toString @@ -78,10 +81,10 @@ public: virtual ExecutionNode* getCopy() const = 0; protected: - /** - * @brief m_nextNode - */ - ExecutionNode* m_previousNode; + /** + * @brief m_nextNode + */ + ExecutionNode* m_previousNode; /** * @brief m_result */ @@ -95,7 +98,7 @@ protected: */ QMap m_errors; - QString m_id; + QString m_id; }; #endif // EXECUTIONNODE_H -- cgit v1.2.3-70-g09d2