From 6cf27a39e9b8f8c5c463f431ae585381d8a7c25e Mon Sep 17 00:00:00 2001 From: Renaud G Date: Sun, 16 Dec 2018 18:15:11 +0100 Subject: remove warning To be Fixed - Dice Gui won't compile anymore --- diceparser.cpp | 103 +++------------------------------------------------------ 1 file changed, 5 insertions(+), 98 deletions(-) (limited to 'diceparser.cpp') diff --git a/diceparser.cpp b/diceparser.cpp index 04e9af6..79e31f5 100644 --- a/diceparser.cpp +++ b/diceparser.cpp @@ -323,99 +323,6 @@ void DiceParser::start() } } -QString DiceParser::displayResult() -{ - QStringList resultList; - for(auto start : m_startNodes) - { - ExecutionNode* next = start; - int nodeCount=0; - int resulCount=0; - while(nullptr != next->getNextNode() ) - { - next = next->getNextNode(); - ++nodeCount; - } - ////////////////////////////////// - // - // Display - // - ////////////////////////////////// - - QString str; - QTextStream stream(&str); - Result* result=next->getResult(); - - QString totalValue("you got %1 ;"); - QString dieValue("D%1 : {%2} "); - - bool scalarDone=false; - while(nullptr!=result) - { - ++resulCount; - if((result->hasResultOfType(Result::SCALAR))&&(!scalarDone)) - { - stream << totalValue.arg(result->getResult(Result::SCALAR).toReal()) << endl; //.arg(m_command) - scalarDone=true; - } - else if(result->hasResultOfType(Result::DICE_LIST)) - { - - DiceResult* myDiceResult = dynamic_cast(result); - if(nullptr!=myDiceResult) - { - - QString resulStr; - quint64 face=0; - for(Die* die : myDiceResult->getResultList()) - { - if(!die->hasBeenDisplayed()) - { - resulStr+=QStringLiteral("%1").arg(die->getValue()); - die->displayed(); - face = die->getFaces(); - - - if(die->hasChildrenValue()) - { - resulStr+=QStringLiteral(" ["); - for(qint64 i : die->getListValue()) - { - resulStr+=QStringLiteral("%1 ").arg(i); - } - resulStr.remove(resulStr.size()-1,1); - resulStr+=QStringLiteral("]"); - } - resulStr+=QStringLiteral(", "); - } - } - resulStr.remove(resulStr.size()-2,2); - - if(!resulStr.isEmpty()) - { - stream << dieValue.arg(face).arg(resulStr); - } - - } - } - else if(result->hasResultOfType(Result::STRING)) - { - stream << result->getResult(Result::STRING).toString(); - } - - result = result->getPrevious(); - } - - QTextStream out(stdout); - out << str << "you rolled: " < DiceParser::getLastIntegerResults() { QList resultValues; @@ -551,7 +458,7 @@ void DiceParser::getDiceResultFromAllInstruction(QList& resu HighLightDice hlDice(die->getListValue(),die->isHighlighted(),die->getColor(), die->hasBeenDisplayed(),die->getFaces()); list.append(hlDice); } - nodeResult.insert(static_cast(faces),list); + nodeResult.insert(faces,list); } result = result->getPrevious(); } @@ -663,7 +570,7 @@ bool DiceParser::hasResultOfType(Result::RESULT_TYPE type, ExecutionNode* node, Result* result=next->getResult(); while((result!=nullptr)&&(!scalarDone)) { - if(result->hasResultOfType(type) && ((!notthelast)||(notthelast && (nullptr!=result->getPrevious())))) + if(result->hasResultOfType(type) && ((!notthelast)||(nullptr!=result->getPrevious()))) { scalarDone=true; } @@ -702,7 +609,7 @@ QList DiceParser::getSumOfDiceResult() } int DiceParser::getStartNodeCount() const { - return m_startNodes.size(); + return static_cast(m_startNodes.size()); } ExecutionNode* DiceParser::getLeafNode(ExecutionNode* start) { @@ -894,7 +801,7 @@ bool DiceParser::readInstructionList(QString& str) { latest = ParsingToolBox::getLatestNode(latest); } - keepParsing = (!str.isEmpty() & (before!=str)); + keepParsing = (!str.isEmpty() && (before!=str)); } } if( !str.isEmpty() && readInstructionOperator(str[0])) @@ -1058,7 +965,7 @@ bool DiceParser::readOption(QString& str,ExecutionNode* previous)//, DiceRollerNode* nodeTmp = dynamic_cast(previous); if(nullptr!=nodeTmp) { - previous = addExplodeDiceNode(nodeTmp->getFaces(),previous); + previous = addExplodeDiceNode(static_cast(nodeTmp->getFaces()),previous); } node = m_parsingToolbox->addSort(previous,ascending); -- cgit v1.2.3-70-g09d2