From 6f499de159eeac37fe473f945042e13359dc2d40 Mon Sep 17 00:00:00 2001 From: Renaud G Date: Thu, 25 Jul 2019 09:59:03 +0200 Subject: move files --- tests/dice/testnode.cpp | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 tests/dice/testnode.cpp (limited to 'tests/dice/testnode.cpp') diff --git a/tests/dice/testnode.cpp b/tests/dice/testnode.cpp new file mode 100644 index 0000000..de9fc05 --- /dev/null +++ b/tests/dice/testnode.cpp @@ -0,0 +1,49 @@ +#include "testnode.h" +#include "die.h" + +TestNode::TestNode() {} + +TestNode::~TestNode() +{ + m_nextNode= nullptr; + m_result= nullptr; +} +void TestNode::run(ExecutionNode* previous) +{ + Q_UNUSED(previous) + if(nullptr != m_nextNode) + { + m_nextNode->run(this); + } +} + +QString TestNode::toString(bool wl) const +{ + if(wl) + { + return QStringLiteral("%1 [label=\"TestNode \"]").arg(m_id); + } + else + { + return m_id; + } +} +qint64 TestNode::getPriority() const +{ + qint64 priority= 4; + return priority; +} +ExecutionNode* TestNode::getCopy() const +{ + TestNode* node= new TestNode(); + if(nullptr != m_nextNode) + { + node->setNextNode(m_nextNode->getCopy()); + } + return node; +} + +void TestNode::setResult(Result* result) +{ + m_result= result; +} -- cgit v1.2.3-70-g09d2