aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorRenaud Guezennec <renaud.guezennec@softbankrobotics.com>2017-11-28 15:48:18 +0100
committerRenaud Guezennec <renaud.guezennec@softbankrobotics.com>2017-11-28 15:48:18 +0100
commitc0c6378cb05de97ecc1ff0be4e66624e6a9bdb3b (patch)
tree5e250db48158f73a9442ca60396c5bb51b787fa4
parent9f08ef2435310b9b6910ac838d3895996a48ec66 (diff)
downloadOneRoll-c0c6378cb05de97ecc1ff0be4e66624e6a9bdb3b.tar.gz
OneRoll-c0c6378cb05de97ecc1ff0be4e66624e6a9bdb3b.zip
-Better indentation
-rw-r--r--diceparser.h28
-rw-r--r--node/executionnode.cpp20
-rw-r--r--node/executionnode.h27
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<ExecutionNode::DICE_ERROR_CODE,QString> m_errors;
- QString m_id;
+ QString m_id;
};
#endif // EXECUTIONNODE_H