From ca574161aac7f5e49fb239e20b0d2c1d3dfd148d Mon Sep 17 00:00:00 2001 From: Renaud G Date: Sat, 21 Oct 2017 18:54:07 +0200 Subject: -better indentation. -update to C++11 standard -New way to store result in list. --- diceparser.h | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'diceparser.h') diff --git a/diceparser.h b/diceparser.h index 5073142..cd031bb 100644 --- a/diceparser.h +++ b/diceparser.h @@ -102,8 +102,11 @@ public: * @return bool every thing is fine or not */ bool parseLine(QString str); - - + /** + * @brief getStartNodeCount + * @return + */ + int getStartNodeCount() const; /** * @brief Start running the execution tree * @@ -126,20 +129,20 @@ public: */ void writeDownDotTree(QString filepath); /** - * @brief getLastIntegerResult + * @brief getLastIntegerResults * @return */ - qreal getLastIntegerResult(); + QList getLastIntegerResults(); /** * @brief getSumOfDiceResult * @return */ - qreal getSumOfDiceResult(); + QList getSumOfDiceResult(); /** * @brief getLastDiceResult * @return */ - void getLastDiceResult(ExportedDiceResult& diceValues,bool& homogeneous); + void getLastDiceResult(QList& diceValues,bool& homogeneous); /** * @brief hasIntegerResultNotInFirst * @return @@ -164,7 +167,7 @@ public: * @brief getStringResult * @return */ - QString getStringResult(); + QStringList getStringResult(); /** * @brief humanReadableError * @return @@ -307,14 +310,14 @@ private: * @brief getLeafNode * @return */ - ExecutionNode* getLeafNode(); + ExecutionNode* getLeafNode(ExecutionNode* node); /** * @brief hasResultOfType * @param notthelast * @return */ - bool hasResultOfType(Result::RESULT_TYPE,bool notthelast = false); + bool hasResultOfType(Result::RESULT_TYPE, ExecutionNode* node, bool notthelast = false); private: @@ -328,7 +331,8 @@ private: QMap m_warningMap; - ExecutionNode* m_start; + ExecutionNode* m_start = nullptr; + QList m_startNodes; ExecutionNode* m_current; QString m_command; ParsingToolBox* m_parsingToolbox; -- cgit v1.2.3-70-g09d2