diff options
| -rw-r--r-- | diceparser.cpp | 10 | ||||
| -rw-r--r-- | node/dicerollernode.cpp | 8 |
2 files changed, 8 insertions, 10 deletions
diff --git a/diceparser.cpp b/diceparser.cpp index 6799416..902f6ba 100644 --- a/diceparser.cpp +++ b/diceparser.cpp @@ -254,6 +254,8 @@ bool DiceParser::readExpression(QString& str,ExecutionNode* & node) { NumberNode* numberNode=new NumberNode(); numberNode->setNumber(1); + ExecutionNode* previous = diceNode->getPreviousNode(); + numberNode->setPreviousNode(previous); numberNode->setNextNode(diceNode); node = numberNode; } @@ -869,6 +871,7 @@ bool DiceParser::readOperator(QString& str,ExecutionNode* previous) } previous->setNextNode(nullptr); m_startNodes.append(nodeExec); + auto test = dynamic_cast<DiceRollerNode*>(nodeExec); m_currentTreeHasSeparator = true; return true; } @@ -925,11 +928,6 @@ bool DiceParser::readOption(QString& str,ExecutionNode* previous)//, { case Keep: { - qDebug() << "keep " << previous->toString(true) << str; - if(str == "4+7") - { - qDebug() << "nauteanuit"; - } qint64 myNumber=0; bool ascending = m_parsingToolbox->readAscending(str); @@ -937,7 +935,7 @@ bool DiceParser::readOption(QString& str,ExecutionNode* previous)//, { node = m_parsingToolbox->addSort(previous,ascending); KeepDiceExecNode* nodeK = new KeepDiceExecNode(); - qDebug() << "nodeK " << previous->toString(true) << str; + //qDebug() << "nodeK " << previous->toString(true) << str; nodeK->setDiceKeepNumber(myNumber); node->setNextNode(nodeK); node = nodeK; diff --git a/node/dicerollernode.cpp b/node/dicerollernode.cpp index 25b9d5a..f2b002d 100644 --- a/node/dicerollernode.cpp +++ b/node/dicerollernode.cpp @@ -16,7 +16,7 @@ DiceRollerNode::DiceRollerNode(qint64 max,qint64 min) } void DiceRollerNode::run(ExecutionNode* previous) { - m_previousNode = previous; + m_previousNode = previous; if(nullptr!=previous) { Result* result=previous->getResult(); @@ -45,7 +45,7 @@ void DiceRollerNode::run(ExecutionNode* previous) m_nextNode->run(this); } } - } + } } quint64 DiceRollerNode::getFaces() const @@ -56,11 +56,11 @@ QString DiceRollerNode::toString(bool wl) const { if(wl) { - return QString("%1 [label=\"DiceRollerNode faces: %2\"]").arg(m_id).arg(getFaces()); + return QString("%1 [label=\"DiceRollerNode faces: %2\"]").arg(m_id).arg(getFaces()); } else { - return m_id; + return m_id; } } qint64 DiceRollerNode::getPriority() const |