aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tests/dice/testnode.h
diff options
context:
space:
mode:
authorrenaud guezennec <renaud@rolisteam.org>2019-07-29 20:35:52 +0000
committerrenaud guezennec <renaud@rolisteam.org>2019-07-29 20:35:52 +0000
commit1a902d383eef1e042d4462cd07b9384fcdf4d118 (patch)
tree766b8ab720fa5da11730d2fc2388f51b9d14de49 /tests/dice/testnode.h
parentf5906125576a8323a731c9456ce3dfc53b67ef59 (diff)
parent0d4b68221bda594cc695d216dfa21306ddb69c85 (diff)
downloadOneRoll-1a902d383eef1e042d4462cd07b9384fcdf4d118.tar.gz
OneRoll-1a902d383eef1e042d4462cd07b9384fcdf4d118.zip
Merge branch 'liberation' into 'master'
Add fuzzer on the DiceParser See merge request kde/rolisteam-diceparser!2
Diffstat (limited to 'tests/dice/testnode.h')
-rw-r--r--tests/dice/testnode.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/dice/testnode.h b/tests/dice/testnode.h
new file mode 100644
index 0000000..5c918ee
--- /dev/null
+++ b/tests/dice/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