aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/node
diff options
context:
space:
mode:
authorRenaud G <renaud@rolisteam.org>2015-05-16 00:05:08 +0200
committerRenaud G <renaud@rolisteam.org>2015-05-16 00:05:08 +0200
commitbb89b91d9919ad9fed8b9d30ea0df79ceea4d3f7 (patch)
tree090223d5ab28601d52c63bb9489835f191cf797a /node
parentb79df1fffd6677a584d6ad8ed44004aae0dad7b4 (diff)
parentf8a2e958e699ca41730cb785e7284c07eaaa5a82 (diff)
downloadOneRoll-bb89b91d9919ad9fed8b9d30ea0df79ceea4d3f7.tar.gz
OneRoll-bb89b91d9919ad9fed8b9d30ea0df79ceea4d3f7.zip
Merge branch 'master' of github.com:obiwankennedy/DiceParser
Diffstat (limited to 'node')
-rw-r--r--node/dicerollernode.cpp5
-rw-r--r--node/dicerollernode.h3
2 files changed, 5 insertions, 3 deletions
diff --git a/node/dicerollernode.cpp b/node/dicerollernode.cpp
index f32a033..06148fc 100644
--- a/node/dicerollernode.cpp
+++ b/node/dicerollernode.cpp
@@ -32,8 +32,8 @@
//////////////////////////////////////////////////
/// \brief DiceRollerNode::DiceRollerNode
//////////////////////////////////////////////////
-DiceRollerNode::DiceRollerNode(quint64 faces)
- : m_faces(faces),m_diceResult(new DiceResult())
+DiceRollerNode::DiceRollerNode(quint64 faces,qint64 offset)
+ : m_faces(faces),m_diceResult(new DiceResult()),m_offset(offset)
{
m_result=m_diceResult;
}
@@ -52,6 +52,7 @@ void DiceRollerNode::run(ExecutionNode* previous)
{
Die* die = new Die();
die->setFaces(m_faces);
+ die->setBase(m_offset);
die->roll();
m_diceResult->insertResult(die);
}
diff --git a/node/dicerollernode.h b/node/dicerollernode.h
index 744a4b5..726676e 100644
--- a/node/dicerollernode.h
+++ b/node/dicerollernode.h
@@ -25,7 +25,7 @@
class DiceRollerNode : public ExecutionNode
{
public:
- DiceRollerNode(quint64 faces);
+ DiceRollerNode(quint64 faces, qint64 offset = 1);
virtual void run(ExecutionNode*);
quint64 getFaces();
@@ -37,6 +37,7 @@ private:
quint64 m_diceCount;
quint64 m_faces; /// faces
DiceResult* m_diceResult;
+ qint64 m_offset;
};
#endif // DICEROLLERNODE_H