aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/node/keepdiceexecnode.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'node/keepdiceexecnode.cpp')
-rw-r--r--node/keepdiceexecnode.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/node/keepdiceexecnode.cpp b/node/keepdiceexecnode.cpp
new file mode 100644
index 0000000..cd2b76e
--- /dev/null
+++ b/node/keepdiceexecnode.cpp
@@ -0,0 +1,27 @@
+#include "keepdiceexecnode.h"
+
+KeepDiceExecNode::KeepDiceExecNode()
+{
+}
+
+void KeepDiceExecNode::run(ExecutionNode* previous)
+{
+ if(NULL==previous)
+ {
+ return;
+ }
+ QList<qint64> diceList=previous->getResult()->getResultList();
+ QList<qint64> diceList2=m_result.getResultList();
+
+
+ diceList2 = diceList.mid(0,m_numberOfDice);
+ m_result.setResultList(diceList2);
+ if(NULL!=m_nextNode)
+ {
+ m_nextNode->run(this);
+ }
+}
+void KeepDiceExecNode::setDiceKeepNumber(quint64 n)
+{
+ m_numberOfDice = n;
+}