diff options
| author | 2018-08-27 01:03:08 +0200 | |
|---|---|---|
| committer | 2018-08-27 01:03:08 +0200 | |
| commit | 64e9988ba715e6e196b84e4a69c871c761562bbd (patch) | |
| tree | 4159ff6831ac34c01069604bebf6b99aad99954a /node | |
| parent | 45d618b710483ee1ae42cbdfcaa0406f1132f384 (diff) | |
| download | OneRoll-64e9988ba715e6e196b84e4a69c871c761562bbd.tar.gz OneRoll-64e9988ba715e6e196b84e4a69c871c761562bbd.zip | |
-New API for validating validor.
Prevent endless loop in R operator.
Diffstat (limited to 'node')
| -rw-r--r-- | node/dicerollernode.cpp | 9 | ||||
| -rw-r--r-- | node/dicerollernode.h | 3 |
2 files changed, 8 insertions, 4 deletions
diff --git a/node/dicerollernode.cpp b/node/dicerollernode.cpp index 6691c38..1d842d6 100644 --- a/node/dicerollernode.cpp +++ b/node/dicerollernode.cpp @@ -22,7 +22,7 @@ void DiceRollerNode::run(ExecutionNode* previous) Result* result=previous->getResult(); if(nullptr!=result) { - m_diceCount = result->getResult(Result::SCALAR).toReal(); + m_diceCount = static_cast<quint64>(result->getResult(Result::SCALAR).toReal()); m_result->setPrevious(result); if(m_diceCount == 0) @@ -67,6 +67,11 @@ quint64 DiceRollerNode::getFaces() const { return abs(m_max-m_min)+1; } + +std::pair<qint64,qint64> DiceRollerNode::getRange() const +{ + return std::make_pair(m_min,m_max); +} QString DiceRollerNode::toString(bool wl) const { if(wl) @@ -85,8 +90,6 @@ qint64 DiceRollerNode::getPriority() const // { // priority = m_nextNode->getPriority(); // } - - return priority; } ExecutionNode* DiceRollerNode::getCopy() const diff --git a/node/dicerollernode.h b/node/dicerollernode.h index 2b4e3dd..8831c8e 100644 --- a/node/dicerollernode.h +++ b/node/dicerollernode.h @@ -5,7 +5,7 @@ #include "executionnode.h" #include "result/diceresult.h" - +#include <utility> /** * @brief The DiceRollerNode class rolls dice of one kind. */ @@ -28,6 +28,7 @@ public: * @return the face count */ quint64 getFaces() const; + std::pair<qint64,qint64> getRange() const; /** * @brief toString |