diff options
| author | 2015-10-11 22:13:07 +0200 | |
|---|---|---|
| committer | 2015-10-11 22:13:07 +0200 | |
| commit | 9e9dd15316e80cae916c532d13ddc5ddc5e93697 (patch) | |
| tree | 52f0daa73bcd36d3562cb80847cc4536355448fc /node/keepdiceexecnode.cpp | |
| parent | 80ff2a99b45a25695321cc84a30a3fbf3b797d54 (diff) | |
| parent | 1ccb6b4c0454fae8ebc4ebdca9ab74588d3d8707 (diff) | |
| download | OneRoll-9e9dd15316e80cae916c532d13ddc5ddc5e93697.tar.gz OneRoll-9e9dd15316e80cae916c532d13ddc5ddc5e93697.zip | |
Merge branch 'master' of github.com:obiwankennedy/DiceParser
Diffstat (limited to 'node/keepdiceexecnode.cpp')
| -rw-r--r-- | node/keepdiceexecnode.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/node/keepdiceexecnode.cpp b/node/keepdiceexecnode.cpp index a230107..64d53f0 100644 --- a/node/keepdiceexecnode.cpp +++ b/node/keepdiceexecnode.cpp @@ -43,6 +43,10 @@ m_previousNode = previous; { QList<Die*> diceList=previousDiceResult->getResultList(); QList<Die*> diceList2 = diceList.mid(0,m_numberOfDice); + if(m_numberOfDice > diceList.size()) + { + m_errors.insert(TOO_MANY_DICE,QObject::tr(" You ask to keep %1 dice but the result only has %2").arg(m_numberOfDice).arg(diceList.size())); + } foreach(Die* tmp,diceList.mid(m_numberOfDice,-1)) { @@ -60,9 +64,16 @@ void KeepDiceExecNode::setDiceKeepNumber(quint64 n) { m_numberOfDice = n; } -QString KeepDiceExecNode::toString() const +QString KeepDiceExecNode::toString(bool wl) const { - return QString("KeepDiceExecNode [label=\"KeepDiceExecNode %1\"]").arg(m_numberOfDice); + if(wl) + { + return QString("%1 [label=\"KeepDiceExecNode %2\"]").arg(m_id).arg(m_numberOfDice); + } + else + { + return m_id; + } } qint64 KeepDiceExecNode::getPriority() const { |