aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/node/keepdiceexecnode.cpp
blob: cd2b76e19945368bbb865663d2b1585e93ac465f (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
#include "keepdiceexecnode.h"

KeepDiceExecNode::KeepDiceExecNode()
{
}

void KeepDiceExecNode::run(ExecutionNode* previous)
{
    if(NULL==previous)
    {
        return;
    }
    QList<qint64> diceList=previous->getResult()->getResultList();
    QList<qint64> diceList2=m_result.getResultList();


    diceList2 = diceList.mid(0,m_numberOfDice);
    m_result.setResultList(diceList2);
    if(NULL!=m_nextNode)
    {
        m_nextNode->run(this);
    }
}
void KeepDiceExecNode::setDiceKeepNumber(quint64 n)
{
    m_numberOfDice = n;
}