From de38199f61635a4206eb44c8e70634086aa20538 Mon Sep 17 00:00:00 2001 From: Renaud G Date: Tue, 9 Dec 2014 20:41:07 +0100 Subject: add help API --- node/executionnode.cpp | 4 ++++ node/executionnode.h | 6 ++++++ node/helpnode.cpp | 20 ++++++++++++++++++++ node/helpnode.h | 29 ++++++++++++++++++++++++++++- node/node.pri | 6 ++++-- 5 files changed, 62 insertions(+), 3 deletions(-) (limited to 'node') 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::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 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: https://github.com/obiwankennedy/DiceParser/blob/master/HelpMe.md"); +} + +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 +#include + +#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 -- cgit v1.2.3-70-g09d2