diff options
| author | 2019-07-25 09:59:29 +0200 | |
|---|---|---|
| committer | 2019-07-25 09:59:29 +0200 | |
| commit | bb6b87a2685c0d71b5c38be33c100f85ac0b9cee (patch) | |
| tree | 81da599ceec1368e55fee5fd6a4dd0173fc39b5f /node/dicerollernode.cpp | |
| parent | 6f499de159eeac37fe473f945042e13359dc2d40 (diff) | |
| download | OneRoll-bb6b87a2685c0d71b5c38be33c100f85ac0b9cee.tar.gz OneRoll-bb6b87a2685c0d71b5c38be33c100f85ac0b9cee.zip | |
Rework of the component to be a proper lib
Diffstat (limited to 'node/dicerollernode.cpp')
| -rw-r--r-- | node/dicerollernode.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/node/dicerollernode.cpp b/node/dicerollernode.cpp index f57d3e3..f87908f 100644 --- a/node/dicerollernode.cpp +++ b/node/dicerollernode.cpp @@ -19,10 +19,10 @@ void DiceRollerNode::run(ExecutionNode* previous) Result* result= previous->getResult(); if(nullptr != result) { - auto num= result->getResult(Result::SCALAR).toReal(); + auto num= result->getResult(Dice::RESULT_TYPE::SCALAR).toReal(); if(num <= 0) { - m_errors.insert(NO_DICE_TO_ROLL, QObject::tr("No dice to roll")); + m_errors.insert(Dice::ERROR_CODE::NO_DICE_TO_ROLL, QObject::tr("No dice to roll")); } m_diceCount= num > 0 ? static_cast<quint64>(num) : 0; m_result->setPrevious(result); @@ -30,7 +30,7 @@ void DiceRollerNode::run(ExecutionNode* previous) auto possibleValue= static_cast<quint64>(std::abs((m_max - m_min) + 1)); if(possibleValue < m_diceCount && m_unique) { - m_errors.insert(TOO_MANY_DICE, + m_errors.insert(Dice::ERROR_CODE::TOO_MANY_DICE, QObject::tr("More unique values asked than possible values (D operator)")); return; } @@ -62,7 +62,7 @@ void DiceRollerNode::run(ExecutionNode* previous) quint64 DiceRollerNode::getFaces() const { - return std::abs(m_max - m_min) + 1; + return static_cast<quint64>(std::abs(m_max - m_min) + 1); } std::pair<qint64, qint64> DiceRollerNode::getRange() const |