From 2685e8e4fbbc480bbc9edf991faace7082987f38 Mon Sep 17 00:00:00 2001 From: Renaud G Date: Tue, 9 Dec 2014 22:07:31 +0100 Subject: -New API for result type. --- diceparser.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'diceparser.cpp') 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(); 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(); } } -- cgit v1.2.3-70-g09d2