diff options
| author | 2015-04-25 11:40:34 +0200 | |
|---|---|---|
| committer | 2015-04-25 11:40:34 +0200 | |
| commit | 74275e3e17b7f8e9409d86382aa355c36e7005bd (patch) | |
| tree | acaf138433264ecf72ca2913bc509068b91691f2 /node/jumpbackwardnode.cpp | |
| parent | 190a6fb86cd3b1ec96ab57f4123a9edee06b88a3 (diff) | |
| download | OneRoll-74275e3e17b7f8e9409d86382aa355c36e7005bd.tar.gz OneRoll-74275e3e17b7f8e9409d86382aa355c36e7005bd.zip | |
better highlightment
Diffstat (limited to 'node/jumpbackwardnode.cpp')
| -rw-r--r-- | node/jumpbackwardnode.cpp | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/node/jumpbackwardnode.cpp b/node/jumpbackwardnode.cpp index af96ed8..d800394 100644 --- a/node/jumpbackwardnode.cpp +++ b/node/jumpbackwardnode.cpp @@ -1,5 +1,5 @@ #include "jumpbackwardnode.h" - +#include <QDebug> JumpBackwardNode::JumpBackwardNode() { @@ -32,12 +32,15 @@ void JumpBackwardNode::run(ExecutionNode* previous) if((NULL!=result)) { --i; - if((i==0)&&(parent->getResult()->hasResultOfType(Result::DICE_LIST))) + if((i==0)&&(result->hasResultOfType(Result::DICE_LIST))) { found =true; } } - parent = parent->getPreviousNode(); + if(!found) + { + parent = parent->getPreviousNode(); + } } DiceResult* diceResult = dynamic_cast<DiceResult*>(result); @@ -46,13 +49,27 @@ void JumpBackwardNode::run(ExecutionNode* previous) Die* tmpdie = new Die(); *tmpdie=*die; m_diceResult->insertResult(tmpdie); + die->displayed(); } - //*m_result = *result; + m_result->setPrevious(parent->getResult()); + + if(NULL!=m_nextNode) { m_nextNode->run(this); } + for(int i =0;i<diceResult->getResultList().size();++i) + { + Die* tmp =diceResult->getResultList().at(i); + Die* tmp2 =m_diceResult->getResultList().at(i); + if(tmp->isHighlighted()) + { + tmp2->setHighlighted(true); + } + } + + } |