diff options
| author | 2014-12-09 20:41:07 +0100 | |
|---|---|---|
| committer | 2014-12-09 20:41:07 +0100 | |
| commit | de38199f61635a4206eb44c8e70634086aa20538 (patch) | |
| tree | 6ba0e179af79a3f8cbef50c28da5ac9c5be47b29 | |
| parent | 8d7e2cc15adf4a82ef6354fbfebfadc3a6bb075c (diff) | |
| download | OneRoll-de38199f61635a4206eb44c8e70634086aa20538.tar.gz OneRoll-de38199f61635a4206eb44c8e70634086aa20538.zip | |
add help API
| -rw-r--r-- | node/executionnode.cpp | 4 | ||||
| -rw-r--r-- | node/executionnode.h | 6 | ||||
| -rw-r--r-- | node/helpnode.cpp | 20 | ||||
| -rw-r--r-- | node/helpnode.h | 29 | ||||
| -rw-r--r-- | node/node.pri | 6 |
5 files changed, 62 insertions, 3 deletions
diff --git a/node/executionnode.cpp b/node/executionnode.cpp index 6d6fe8b..cec9036 100644 --- a/node/executionnode.cpp +++ b/node/executionnode.cpp @@ -26,3 +26,7 @@ QList<ExecutionNode::ERROR_CODE> ExecutionNode::getErrorList() { return m_errors; } +QString ExecutionNode::getHelp() +{ + return QString(); +} diff --git a/node/executionnode.h b/node/executionnode.h index ef6faa3..ef5fce8 100644 --- a/node/executionnode.h +++ b/node/executionnode.h @@ -52,6 +52,12 @@ public: * @return */ virtual QList<ExecutionNode::ERROR_CODE> getErrorList(); + + /** + * @brief getHelp + * @return + */ + virtual QString getHelp(); protected: /** * @brief m_result diff --git a/node/helpnode.cpp b/node/helpnode.cpp index 77da788..a11c2b3 100644 --- a/node/helpnode.cpp +++ b/node/helpnode.cpp @@ -3,3 +3,23 @@ HelpNode::HelpNode() { } +void HelpNode::run(ExecutionNode* previous) +{ + if(NULL != previous) + { + + } + else + { + + } +} +QString HelpNode::toString()const +{ + return QObject::tr("see full documentation at: <a href=\"https://github.com/obiwankennedy/DiceParser/blob/master/HelpMe.md\">https://github.com/obiwankennedy/DiceParser/blob/master/HelpMe.md</a>"); +} + +qint64 HelpNode::getPriority() const +{ + return 0; +} diff --git a/node/helpnode.h b/node/helpnode.h index 89aba11..f8b3f78 100644 --- a/node/helpnode.h +++ b/node/helpnode.h @@ -1,10 +1,37 @@ #ifndef HELPNODE_H #define HELPNODE_H +#include "executionnode.h" -class HelpNode : public ExecuteNode +#include <QObject> +#include <QString> + +#include "stringresult.h" + +/** + * @brief The HelpNode class + */ +class HelpNode : public ExecutionNode { public: + /** + * @brief HelpNode + */ HelpNode(); + /** + * @brief run + * @param previous + */ + void run(ExecutionNode* previous); + /** + * @brief toString + * @return + */ + virtual QString toString()const; + /** + * @brief getPriority + * @return + */ + virtual qint64 getPriority() const; }; #endif // HELPNODE_H diff --git a/node/node.pri b/node/node.pri index 4a7d55d..fadbd22 100644 --- a/node/node.pri +++ b/node/node.pri @@ -9,7 +9,8 @@ HEADERS += \ node/keepdiceexecnode.h \ node/countexecutenode.h \ node/explosedicenode.h \ - node/parenthesesnode.h + node/parenthesesnode.h \ + node/helpnode.h SOURCES += \ node/dicerollernode.cpp \ @@ -22,4 +23,5 @@ SOURCES += \ node/keepdiceexecnode.cpp \ node/countexecutenode.cpp \ node/explosedicenode.cpp \ - node/parenthesesnode.cpp + node/parenthesesnode.cpp \ + node/helpnode.cpp |