From bcf1b0c9c285230b28126e270deac12a88d12ebd Mon Sep 17 00:00:00 2001 From: obiwankennedy Date: Tue, 7 Jan 2014 18:43:20 +0100 Subject: Update dicerollernode.cpp insert roll value instead of value --- node/dicerollernode.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'node/dicerollernode.cpp') 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 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) { -- cgit v1.2.3-70-g09d2