diff options
| author | 2019-07-11 22:57:21 +0200 | |
|---|---|---|
| committer | 2019-07-11 23:28:42 +0200 | |
| commit | 48c470b72cf32c49dc146f5859d67708759997b2 (patch) | |
| tree | 4205c6ef6b95830edb507cc8ee68bb1bf7c00ab4 /tests/testnode.h | |
| parent | 69373b4ec96b7d510e16fccfa1b9f2a2ec790508 (diff) | |
| download | OneRoll-48c470b72cf32c49dc146f5859d67708759997b2.tar.gz OneRoll-48c470b72cf32c49dc146f5859d67708759997b2.zip | |
rework diceparser to run unit tests
Diffstat (limited to 'tests/testnode.h')
| -rw-r--r-- | tests/testnode.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/testnode.h b/tests/testnode.h new file mode 100644 index 0000000..5c918ee --- /dev/null +++ b/tests/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 |