diff options
| author | 2016-11-28 00:36:15 +0100 | |
|---|---|---|
| committer | 2016-11-28 00:36:15 +0100 | |
| commit | 13e297604b00615d47352538e3c82ea1ac700d4c (patch) | |
| tree | 567efe03594d261831897f03a7821c4c6eeac59b /node/countexecutenode.cpp | |
| parent | cdd1716bd1aa8d9bbd0137aa98ff24867b6b3a0e (diff) | |
| download | OneRoll-13e297604b00615d47352538e3c82ea1ac700d4c.tar.gz OneRoll-13e297604b00615d47352538e3c82ea1ac700d4c.zip | |
-Add API for copying a branch of execution node.
-Allow to use if node several times.
Diffstat (limited to 'node/countexecutenode.cpp')
| -rw-r--r-- | node/countexecutenode.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/node/countexecutenode.cpp b/node/countexecutenode.cpp index 89b21e5..1f78fd2 100644 --- a/node/countexecutenode.cpp +++ b/node/countexecutenode.cpp @@ -35,7 +35,10 @@ void CountExecuteNode::run(ExecutionNode *previous) qint64 sum = 0; foreach(Die* dice,diceList) { - sum+=m_validator->hasValid(dice,true,true); + if(NULL!=m_validator) + { + sum+=m_validator->hasValid(dice,true,true); + } } m_scalarResult->setValue(sum); @@ -66,5 +69,20 @@ qint64 CountExecuteNode::getPriority() const } - return priority; + return priority; +} + +ExecutionNode* CountExecuteNode::getCopy() const +{ + CountExecuteNode* node = new CountExecuteNode(); + if(NULL!=m_validator) + { + node->setValidator(m_validator->getCopy()); + } + if(NULL!=m_nextNode) + { + node->setNextNode(m_nextNode->getCopy()); + } + return node; + } |