diff options
| author | 2014-12-09 22:07:31 +0100 | |
|---|---|---|
| committer | 2014-12-09 22:07:31 +0100 | |
| commit | 2685e8e4fbbc480bbc9edf991faace7082987f38 (patch) | |
| tree | fcd9b208f08a36346134de6c8ee3913b8d31fc2f /diceparser.cpp | |
| parent | fa1c05a58698d3a6c049479eb8f7d88ac9ddb348 (diff) | |
| download | OneRoll-2685e8e4fbbc480bbc9edf991faace7082987f38.tar.gz OneRoll-2685e8e4fbbc480bbc9edf991faace7082987f38.zip | |
-New API for result type.
Diffstat (limited to 'diceparser.cpp')
| -rw-r--r-- | diceparser.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/diceparser.cpp b/diceparser.cpp index 5d4a610..9f745f1 100644 --- a/diceparser.cpp +++ b/diceparser.cpp @@ -34,6 +34,7 @@ #include "node/rerolldicenode.h" #include "node/explosedicenode.h" #include "node/parenthesesnode.h" +#include "node/helpnode.h" #define DEFAULT_FACES_NUMBER 10 @@ -64,6 +65,7 @@ DiceParser::DiceParser() m_commandList = new QList<QString>(); m_commandList->append("help"); + } ExecutionNode* DiceParser::getLatestNode(ExecutionNode* node) @@ -202,9 +204,9 @@ QString DiceParser::displayResult() while(NULL!=myResult) { ++resulCount; - if((myResult->isScalar())&&(!scalarDone)) + if((myResult->hasResultOfType(Result::SCALAR))&&(!scalarDone)) { - stream << totalValue.arg(myResult->getScalar()) << endl; //.arg(m_command) + stream << totalValue.arg(myResult->getResult(Result::SCALAR).toReal()) << endl; //.arg(m_command) scalarDone=true; } @@ -306,7 +308,7 @@ bool DiceParser::readCommand(QString& str,ExecutionNode* & node) { if(m_commandList->contains(str)) { - // node = new HelpNode(); + node = new HelpNode(); } } |