diff options
Diffstat (limited to 'node')
| -rw-r--r-- | node/keepdiceexecnode.cpp | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/node/keepdiceexecnode.cpp b/node/keepdiceexecnode.cpp index cd2b76e..d700f8e 100644 --- a/node/keepdiceexecnode.cpp +++ b/node/keepdiceexecnode.cpp @@ -1,7 +1,13 @@ +#include <QList> + + #include "keepdiceexecnode.h" + KeepDiceExecNode::KeepDiceExecNode() + : m_diceResult(new DiceResult()) { + m_result = m_diceResult; } void KeepDiceExecNode::run(ExecutionNode* previous) @@ -10,15 +16,19 @@ void KeepDiceExecNode::run(ExecutionNode* previous) { return; } - QList<qint64> diceList=previous->getResult()->getResultList(); - QList<qint64> diceList2=m_result.getResultList(); + DiceResult* previousDiceResult = static_cast<DiceResult*>(previous->getResult()); + if(NULL!=previousDiceResult) + { + QList<Die> diceList=previousDiceResult->getResultList(); + QList<Die> diceList2=m_diceResult->getResultList(); - diceList2 = diceList.mid(0,m_numberOfDice); - m_result.setResultList(diceList2); - if(NULL!=m_nextNode) - { - m_nextNode->run(this); + diceList2 = diceList.mid(0,m_numberOfDice); + m_diceResult->setResultList(diceList2); + if(NULL!=m_nextNode) + { + m_nextNode->run(this); + } } } void KeepDiceExecNode::setDiceKeepNumber(quint64 n) |