File indexing completed on 2024-05-12 05:39:32
0001 #ifndef TESTNODE_H 0002 #define TESTNODE_H 0003 0004 #include <Qt> 0005 0006 #include "executionnode.h" 0007 #include "result/diceresult.h" 0008 #include <utility> 0009 /** 0010 * @brief The TestNode class replaces any kind of node for test purpose. 0011 */ 0012 class TestNode : public ExecutionNode 0013 { 0014 public: 0015 /** 0016 * @brief TestNode builds an instance 0017 * @param faces, number of faces of dices 0018 * @param offset, first value of dice. 0019 */ 0020 TestNode(); 0021 virtual ~TestNode() override; 0022 0023 /** 0024 * @brief run - starts to roll dice. 0025 */ 0026 virtual void run(ExecutionNode*) override; 0027 /** 0028 * @brief toString 0029 * @param wl 0030 * @return use to generate dot tree; 0031 */ 0032 virtual QString toString(bool wl) const override; 0033 /** 0034 * @brief getPriority 0035 * @return priority for dice roll: 4 (higher) 0036 */ 0037 virtual qint64 getPriority() const override; 0038 0039 virtual ExecutionNode* getCopy() const override; 0040 0041 void setResult(Result* result); 0042 }; 0043 0044 #endif // TESTNODE_H