diff options
Diffstat (limited to 'node')
| -rw-r--r-- | node/countexecutenode.cpp | 2 | ||||
| -rw-r--r-- | node/dicerollernode.cpp | 1 | ||||
| -rw-r--r-- | node/executionnode.cpp | 4 | ||||
| -rw-r--r-- | node/executionnode.h | 11 | ||||
| -rw-r--r-- | node/explosedicenode.cpp | 1 | ||||
| -rw-r--r-- | node/helpnode.cpp | 1 | ||||
| -rw-r--r-- | node/keepdiceexecnode.cpp | 2 | ||||
| -rw-r--r-- | node/node.pri | 6 | ||||
| -rw-r--r-- | node/numbernode.cpp | 1 | ||||
| -rw-r--r-- | node/parenthesesnode.cpp | 2 | ||||
| -rw-r--r-- | node/rerolldicenode.cpp | 2 | ||||
| -rw-r--r-- | node/scalaroperatornode.cpp | 1 | ||||
| -rw-r--r-- | node/sortresult.cpp | 2 | ||||
| -rw-r--r-- | node/startingnode.cpp | 2 |
14 files changed, 29 insertions, 9 deletions
diff --git a/node/countexecutenode.cpp b/node/countexecutenode.cpp index ce0249f..a663544 100644 --- a/node/countexecutenode.cpp +++ b/node/countexecutenode.cpp @@ -15,7 +15,7 @@ void CountExecuteNode::setValidator(Validator* validator) void CountExecuteNode::run(ExecutionNode *previous) { -// qDebug() << "CountExecuteNode node"; + m_previousNode = previous; if(NULL==previous) { return; diff --git a/node/dicerollernode.cpp b/node/dicerollernode.cpp index 6a203b9..8eecf0d 100644 --- a/node/dicerollernode.cpp +++ b/node/dicerollernode.cpp @@ -41,6 +41,7 @@ DiceRollerNode::DiceRollerNode(quint64 faces) } void DiceRollerNode::run(ExecutionNode* previous) { + m_previousNode = previous; if(NULL!=previous) { Result* result=previous->getResult(); diff --git a/node/executionnode.cpp b/node/executionnode.cpp index cec9036..e1b71b0 100644 --- a/node/executionnode.cpp +++ b/node/executionnode.cpp @@ -30,3 +30,7 @@ QString ExecutionNode::getHelp() { return QString(); } +ExecutionNode* ExecutionNode::getPreviousNode() const +{ + return m_previousNode; +} diff --git a/node/executionnode.h b/node/executionnode.h index ef5fce8..e10ccb6 100644 --- a/node/executionnode.h +++ b/node/executionnode.h @@ -27,7 +27,7 @@ public: * @brief getResult * @return */ - Result* getResult(); + virtual Result* getResult(); /** * @brief setNextNode */ @@ -37,6 +37,11 @@ public: * @return */ ExecutionNode* getNextNode(); + /** + * @brief getPreviousNode + * @return + */ + virtual ExecutionNode* getPreviousNode() const; /** * @brief toString * @return @@ -59,6 +64,10 @@ public: */ virtual QString getHelp(); protected: + /** + * @brief m_nextNode + */ + ExecutionNode* m_previousNode; /** * @brief m_result */ diff --git a/node/explosedicenode.cpp b/node/explosedicenode.cpp index 9228190..42b3c2d 100644 --- a/node/explosedicenode.cpp +++ b/node/explosedicenode.cpp @@ -7,6 +7,7 @@ ExploseDiceNode::ExploseDiceNode() } void ExploseDiceNode::run(ExecutionNode* previous) { + m_previousNode = previous; if((NULL!=previous)&&(NULL!=previous->getResult())) { DiceResult* previous_result = static_cast<DiceResult*>(previous->getResult()); diff --git a/node/helpnode.cpp b/node/helpnode.cpp index a46d29a..9a0504e 100644 --- a/node/helpnode.cpp +++ b/node/helpnode.cpp @@ -6,6 +6,7 @@ HelpNode::HelpNode() } void HelpNode::run(ExecutionNode* previous) { + m_previousNode = previous; StringResult* txtResult = dynamic_cast<StringResult*>(m_result); qDebug() << m_result->hasResultOfType(Result::SCALAR) << m_result->hasResultOfType(Result::STRING); diff --git a/node/keepdiceexecnode.cpp b/node/keepdiceexecnode.cpp index c219e77..62b4c8f 100644 --- a/node/keepdiceexecnode.cpp +++ b/node/keepdiceexecnode.cpp @@ -12,7 +12,7 @@ KeepDiceExecNode::KeepDiceExecNode() void KeepDiceExecNode::run(ExecutionNode* previous) { -// qDebug() << "KeepDiceExecNode node"; +m_previousNode = previous; if(NULL==previous) { return; diff --git a/node/node.pri b/node/node.pri index fadbd22..d65d3e7 100644 --- a/node/node.pri +++ b/node/node.pri @@ -10,7 +10,8 @@ HEADERS += \ node/countexecutenode.h \ node/explosedicenode.h \ node/parenthesesnode.h \ - node/helpnode.h + node/helpnode.h \ + $$PWD/jumpbackwardnode.h SOURCES += \ node/dicerollernode.cpp \ @@ -24,4 +25,5 @@ SOURCES += \ node/countexecutenode.cpp \ node/explosedicenode.cpp \ node/parenthesesnode.cpp \ - node/helpnode.cpp + node/helpnode.cpp \ + $$PWD/jumpbackwardnode.cpp diff --git a/node/numbernode.cpp b/node/numbernode.cpp index e30426e..4e9d9a3 100644 --- a/node/numbernode.cpp +++ b/node/numbernode.cpp @@ -7,6 +7,7 @@ NumberNode::NumberNode() } void NumberNode::run(ExecutionNode* previous) { + m_previousNode = previous; if(NULL!=previous) { m_result->setPrevious(previous->getResult()); diff --git a/node/parenthesesnode.cpp b/node/parenthesesnode.cpp index 0f7002a..f76d33c 100644 --- a/node/parenthesesnode.cpp +++ b/node/parenthesesnode.cpp @@ -10,7 +10,7 @@ void ParenthesesNode::setInternelNode(ExecutionNode* node) } void ParenthesesNode::run(ExecutionNode* /*previous*/) { -// qDebug() << "ParenthesesNode node"; + m_previousNode = NULL; if(NULL!=m_internalNode) { m_internalNode->run(this); diff --git a/node/rerolldicenode.cpp b/node/rerolldicenode.cpp index 397d791..56bef61 100644 --- a/node/rerolldicenode.cpp +++ b/node/rerolldicenode.cpp @@ -8,7 +8,7 @@ RerollDiceNode::RerollDiceNode() } void RerollDiceNode::run(ExecutionNode* previous) { -// qDebug() << "RerollDiceNode node"; +m_previousNode = previous; if((NULL!=previous)&&(NULL!=previous->getResult())) { DiceResult* previous_result = static_cast<DiceResult*>(previous->getResult()); diff --git a/node/scalaroperatornode.cpp b/node/scalaroperatornode.cpp index fb7a110..6cef1a9 100644 --- a/node/scalaroperatornode.cpp +++ b/node/scalaroperatornode.cpp @@ -18,6 +18,7 @@ ScalarOperatorNode::ScalarOperatorNode() void ScalarOperatorNode::run(ExecutionNode* previous) { + m_previousNode = previous; if(NULL!=m_internalNode) { m_internalNode->run(this); diff --git a/node/sortresult.cpp b/node/sortresult.cpp index c80ebec..5d7f142 100644 --- a/node/sortresult.cpp +++ b/node/sortresult.cpp @@ -12,7 +12,7 @@ SortResultNode::SortResultNode() } void SortResultNode::run(ExecutionNode* node) { -// qDebug() << "SortResultNode node"; + m_previousNode = node; if(NULL==node) { return; diff --git a/node/startingnode.cpp b/node/startingnode.cpp index 9395e53..7ce1e38 100644 --- a/node/startingnode.cpp +++ b/node/startingnode.cpp @@ -7,7 +7,7 @@ StartingNode::StartingNode() } void StartingNode::run(ExecutionNode*) { -// qDebug() << "starting node"; + m_previousNode = NULL; if(NULL!=m_nextNode) { m_nextNode->run(this); |