From bb6b87a2685c0d71b5c38be33c100f85ac0b9cee Mon Sep 17 00:00:00 2001 From: Renaud G Date: Thu, 25 Jul 2019 09:59:29 +0200 Subject: Rework of the component to be a proper lib --- node/dicerollernode.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'node/dicerollernode.cpp') 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(num) : 0; m_result->setPrevious(result); @@ -30,7 +30,7 @@ void DiceRollerNode::run(ExecutionNode* previous) auto possibleValue= static_cast(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(std::abs(m_max - m_min) + 1); } std::pair DiceRollerNode::getRange() const -- cgit v1.2.3-70-g09d2