aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/node/dicerollernode.h
blob: dcdbeb21fa599eff7c14aace2ef77416b86c7ce8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef DICEROLLERNODE_H
#define DICEROLLERNODE_H

#include <Qt>

#include "executionnode.h"
#include "result/diceresult.h"

/**
 * @brief The DiceRollerNode class rolls dice of one kind.
 */
class DiceRollerNode : public ExecutionNode
{
public:
	/**
	 * @brief DiceRollerNode builds an instance
	 * @param faces, number of faces of dices
	 * @param offset, first value of dice.
	 */
    DiceRollerNode(qint64 max, qint64 min = 1);

	/**
	 * @brief run - starts to roll dice.
	 */
    virtual void run(ExecutionNode*);
	/**
	 * @brief getFaces accessor
	 * @return the face count
	 */
    quint64 getFaces() const;

	/**
	  * @brief toString
	  * @param wl
	  * @return use to generate dot tree;
	  */
	 virtual QString toString(bool wl)const;
	/**
	  * @brief getPriority
	  * @return priority for dice roll: 4 (higher)
	  */
     virtual qint64 getPriority() const;

    virtual ExecutionNode* getCopy() const;

//private members
private:
    quint64 m_diceCount;
    qint64 m_max; /// faces
	DiceResult* m_diceResult;
    qint64 m_min;
};

#endif // DICEROLLERNODE_H