aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/node
diff options
context:
space:
mode:
Diffstat (limited to 'node')
-rw-r--r--node/dicerollernode.cpp14
-rw-r--r--node/dicerollernode.h6
-rw-r--r--node/ifnode.cpp2
-rw-r--r--node/listsetrollnode.cpp4
4 files changed, 13 insertions, 13 deletions
diff --git a/node/dicerollernode.cpp b/node/dicerollernode.cpp
index 2641ab7..c3062c9 100644
--- a/node/dicerollernode.cpp
+++ b/node/dicerollernode.cpp
@@ -9,8 +9,8 @@
-DiceRollerNode::DiceRollerNode(quint64 faces,qint64 offset)
- : m_faces(faces),m_diceResult(new DiceResult()),m_offset(offset)
+DiceRollerNode::DiceRollerNode(quint64 max,qint64 min)
+ : m_max(max),m_diceResult(new DiceResult()),m_min(min)
{
m_result=m_diceResult;
}
@@ -33,8 +33,8 @@ void DiceRollerNode::run(ExecutionNode* previous)
for(quint64 i=0; i < m_diceCount ; ++i)
{
Die* die = new Die();
- die->setFaces(m_faces);
- die->setBase(m_offset);
+ die->setBase(m_min);
+ die->setMaxValue(m_max);
die->roll();
//qDebug() << die->getValue() << "value";
m_diceResult->insertResult(die);
@@ -49,13 +49,13 @@ void DiceRollerNode::run(ExecutionNode* previous)
quint64 DiceRollerNode::getFaces() const
{
- return m_faces;
+ return abs(m_max-m_min)+1;
}
QString DiceRollerNode::toString(bool wl) const
{
if(wl)
{
- return QString("%1 [label=\"DiceRollerNode faces: %2\"]").arg(m_id).arg(m_faces);
+ return QString("%1 [label=\"DiceRollerNode faces: %2\"]").arg(m_id).arg(getFaces());
}
else
{
@@ -75,7 +75,7 @@ qint64 DiceRollerNode::getPriority() const
}
ExecutionNode* DiceRollerNode::getCopy() const
{
- DiceRollerNode* node = new DiceRollerNode(m_faces,m_offset);
+ DiceRollerNode* node = new DiceRollerNode(m_max,m_min);
if(NULL!=m_nextNode)
{
node->setNextNode(m_nextNode->getCopy());
diff --git a/node/dicerollernode.h b/node/dicerollernode.h
index 4e2f9d7..ab5c47f 100644
--- a/node/dicerollernode.h
+++ b/node/dicerollernode.h
@@ -17,7 +17,7 @@ public:
* @param faces, number of faces of dices
* @param offset, first value of dice.
*/
- DiceRollerNode(quint64 faces, qint64 offset = 1);
+ DiceRollerNode(quint64 max, qint64 min = 1);
/**
* @brief run - starts to roll dice.
@@ -46,9 +46,9 @@ public:
//private members
private:
quint64 m_diceCount;
- quint64 m_faces; /// faces
+ qint64 m_max; /// faces
DiceResult* m_diceResult;
- qint64 m_offset;
+ qint64 m_min;
};
#endif // DICEROLLERNODE_H
diff --git a/node/ifnode.cpp b/node/ifnode.cpp
index b1ca1da..27b588f 100644
--- a/node/ifnode.cpp
+++ b/node/ifnode.cpp
@@ -137,7 +137,7 @@ void IfNode::run(ExecutionNode *previous)
{
Die* dice = new Die();
dice->setValue(value);
- dice->setFaces(value);
+ dice->setMaxValue(value);
if(m_validator->hasValid(dice,true,true))
{
nextNode=m_true;
diff --git a/node/listsetrollnode.cpp b/node/listsetrollnode.cpp
index fa66710..488721a 100644
--- a/node/listsetrollnode.cpp
+++ b/node/listsetrollnode.cpp
@@ -99,7 +99,7 @@ void ListSetRollNode::computeFacesNumber(Die* die)
{
if(m_rangeList.isEmpty())
{
- die->setFaces(m_values.size());
+ die->setMaxValue(m_values.size());
}
else
{
@@ -116,7 +116,7 @@ void ListSetRollNode::computeFacesNumber(Die* die)
++i;
}
//qDebug() << "set Faces"<<max;
- die->setFaces(max);
+ die->setMaxValue(max);
}
}