aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/node
diff options
context:
space:
mode:
authorobiwankennedy <renaud@rolisteam.org>2014-01-07 18:52:28 +0100
committerobiwankennedy <renaud@rolisteam.org>2014-01-07 18:52:28 +0100
commit62d37d86caa5704fccc0d9c3a41d6e0d22e9603d (patch)
treeaf96e224be8afb72e6e1b0f8f866677d160b8bca /node
parenta0729413733160e3915b630485144c22cd0c3566 (diff)
downloadOneRoll-62d37d86caa5704fccc0d9c3a41d6e0d22e9603d.tar.gz
OneRoll-62d37d86caa5704fccc0d9c3a41d6e0d22e9603d.zip
Update keepdiceexecnode.cpp
better API
Diffstat (limited to 'node')
-rw-r--r--node/keepdiceexecnode.cpp24
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)