diff options
| -rw-r--r-- | node/dicerollernode.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/node/dicerollernode.cpp b/node/dicerollernode.cpp index f068f4b..7530730 100644 --- a/node/dicerollernode.cpp +++ b/node/dicerollernode.cpp @@ -6,21 +6,23 @@ #include <QDebug> DiceRollerNode::DiceRollerNode(quint64 faces) - : m_faces(faces) + : m_faces(faces),m_myDiceResult(new DiceResult()) { uint seed = quintptr(this) + QDateTime::currentDateTime().toMSecsSinceEpoch(); qsrand(seed); + m_result=m_myDiceResult; + } void DiceRollerNode::run(ExecutionNode* previous) { if(NULL!=previous) { - m_diceCount = previous->getResult()->getSum(); + m_diceCount = previous->getResult()->getScalar(); for(quint64 i=0; i < m_diceCount ; ++i) { Die die; - die.setValue(rollDice()); - m_result.insertResult(die); + die.insertRollValue(rollDice()); + m_myDiceResult->insertResult(die); } if(NULL!=m_nextNode) { |