aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/node/testnode.h
diff options
context:
space:
mode:
authorRenaud G <renaud@rolisteam.org>2019-05-08 17:11:29 +0200
committerRenaud G <renaud@rolisteam.org>2019-05-08 17:12:25 +0200
commit90cec3957ff5e61981f9068a1fac3cb44a3e7d41 (patch)
tree6f6a245e72b83d1b774d507b446a5383a5e499bf /node/testnode.h
parentcf5bc61b43e41667a016a01666cbe6391a59cdfe (diff)
downloadOneRoll-90cec3957ff5e61981f9068a1fac3cb44a3e7d41.tar.gz
OneRoll-90cec3957ff5e61981f9068a1fac3cb44a3e7d41.zip
Add test node.
Diffstat (limited to 'node/testnode.h')
-rw-r--r--node/testnode.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/node/testnode.h b/node/testnode.h
new file mode 100644
index 0000000..5c918ee
--- /dev/null
+++ b/node/testnode.h
@@ -0,0 +1,44 @@
+#ifndef TESTNODE_H
+#define TESTNODE_H
+
+#include <Qt>
+
+#include "executionnode.h"
+#include "result/diceresult.h"
+#include <utility>
+/**
+ * @brief The TestNode class replaces any kind of node for test purpose.
+ */
+class TestNode : public ExecutionNode
+{
+public:
+ /**
+ * @brief TestNode builds an instance
+ * @param faces, number of faces of dices
+ * @param offset, first value of dice.
+ */
+ TestNode();
+ virtual ~TestNode() override;
+
+ /**
+ * @brief run - starts to roll dice.
+ */
+ virtual void run(ExecutionNode*) override;
+ /**
+ * @brief toString
+ * @param wl
+ * @return use to generate dot tree;
+ */
+ virtual QString toString(bool wl) const override;
+ /**
+ * @brief getPriority
+ * @return priority for dice roll: 4 (higher)
+ */
+ virtual qint64 getPriority() const override;
+
+ virtual ExecutionNode* getCopy() const override;
+
+ void setResult(Result* result);
+};
+
+#endif // TESTNODE_H