aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/node/dicerollernode.cpp
diff options
context:
space:
mode:
authorobiwankennedy <renaud@rolisteam.org>2014-01-07 18:43:20 +0100
committerobiwankennedy <renaud@rolisteam.org>2014-01-07 18:43:20 +0100
commitbcf1b0c9c285230b28126e270deac12a88d12ebd (patch)
tree1626cf2cb6515a3e344cf67336f37363eb10c85e /node/dicerollernode.cpp
parent852d27cf4da5a31f192bfb96d8b477962c72aecc (diff)
downloadOneRoll-bcf1b0c9c285230b28126e270deac12a88d12ebd.tar.gz
OneRoll-bcf1b0c9c285230b28126e270deac12a88d12ebd.zip
Update dicerollernode.cpp
insert roll value instead of value
Diffstat (limited to 'node/dicerollernode.cpp')
-rw-r--r--node/dicerollernode.cpp10
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)
{