From 9ac00a7658e81a045a68668df7ead5bb7c27254c Mon Sep 17 00:00:00 2001 From: Renaud G Date: Sat, 6 Dec 2014 10:15:13 +0100 Subject: -Add comments --- diceresult.h | 4 +++- die.h | 66 ++++++++++++++++++++++++++++++++++++++++++++++++---- node/executionnode.h | 45 +++++++++++++++++++++++++++++++++++ result.h | 4 +++- 4 files changed, 112 insertions(+), 7 deletions(-) diff --git a/diceresult.h b/diceresult.h index 9bd2cde..ff3edc3 100644 --- a/diceresult.h +++ b/diceresult.h @@ -25,7 +25,9 @@ #include "die.h" #include "result.h" - +/** + * @brief The DiceResult class + */ class DiceResult : public Result { public: diff --git a/die.h b/die.h index 99596a9..776b54b 100644 --- a/die.h +++ b/die.h @@ -24,31 +24,87 @@ #include +/** + * @brief The Die class + */ class Die { public: + /** + * @brief Die + */ Die(); + /** + * @brief setValue + * @param r + */ void setValue(qint64 r); + /** + * @brief setFaces + * @param face + */ void setFaces(quint64 face); + /** + * @brief insertRollValue + * @param r + */ void insertRollValue(qint64 r); + /** + * @brief setSelected + * @param b + */ void setSelected(bool b); - + /** + * @brief isSelected + * @return + */ bool isSelected() const; + /** + * @brief getValue + * @return + */ qint64 getValue() const; + /** + * @brief getListValue + * @return + */ QList getListValue() const; - + /** + * @brief hasChildrenValue + * @return + */ bool hasChildrenValue(); - + /** + * @brief roll + * @param adding + */ void roll(bool adding = false); + /** + * @brief replaceLastValue + * @param value + */ void replaceLastValue(qint64 value); - + /** + * @brief getLastRolledValue + * @return + */ qint64 getLastRolledValue(); + /** + * @brief getFaces + * @return + */ quint64 getFaces(); - + /** + * @brief hasBeenDisplayed + * @return + */ bool hasBeenDisplayed(); + /** + * @brief displayed + */ void displayed(); private: diff --git a/node/executionnode.h b/node/executionnode.h index b83a6f1..ef6faa3 100644 --- a/node/executionnode.h +++ b/node/executionnode.h @@ -3,22 +3,67 @@ #include "result.h" #include +/** + * @brief The ExecutionNode class + */ class ExecutionNode { public: enum ERROR_CODE {NO_ERROR,DIE_RESULT_EXPECTED,BAD_SYNTAXE}; + /** + * @brief ExecutionNode + */ ExecutionNode(); + /** + * @brief ~ExecutionNode + */ virtual ~ExecutionNode(); + /** + * @brief run + * @param previous + */ virtual void run(ExecutionNode* previous = NULL)=0; + /** + * @brief getResult + * @return + */ Result* getResult(); + /** + * @brief setNextNode + */ void setNextNode(ExecutionNode*); + /** + * @brief getNextNode + * @return + */ ExecutionNode* getNextNode(); + /** + * @brief toString + * @return + */ virtual QString toString()const=0; + /** + * @brief getPriority + * @return + */ virtual qint64 getPriority() const=0; + /** + * @brief getErrorList + * @return + */ virtual QList getErrorList(); protected: + /** + * @brief m_result + */ Result* m_result; + /** + * @brief m_nextNode + */ ExecutionNode* m_nextNode; + /** + * @brief m_errors + */ QList m_errors; }; diff --git a/result.h b/result.h index 3f2ab15..c0317ce 100644 --- a/result.h +++ b/result.h @@ -23,7 +23,9 @@ #define RESULT_H #include - +/** + * @brief The Result class + */ class Result { public: -- cgit v1.2.3-70-g09d2