Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Rolisteam/DiceParser
Browse files Browse the repository at this point in the history
  • Loading branch information
Renaud G committed Jun 3, 2017
2 parents f99aea2 + 34b4cd5 commit 91d8d76
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ compute: 100/28 = 3
3*3 = 9


More examples at : https://github.com/obiwankennedy/DiceParser/blob/master/HelpMe.md
More examples at : https://github.com/Rolisteam/DiceParser/blob/master/HelpMe.md
2 changes: 2 additions & 0 deletions diceparser.pri
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ HEADERS += \
$$PWD/node/mergenode.h \
$$PWD/node/listaliasnode.h \
$$PWD/node/ifnode.h \
$$PWD/node/splitnode.h \
$$PWD/node/paintnode.h \
$$PWD/node/listsetrollnode.h

Expand All @@ -78,6 +79,7 @@ SOURCES += \
$$PWD/node/listaliasnode.cpp \
$$PWD/node/paintnode.cpp \
$$PWD/node/ifnode.cpp \
$$PWD/node/splitnode.cpp \
$$PWD/node/listsetrollnode.cpp


Expand Down
2 changes: 1 addition & 1 deletion node/dicerollernode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


DiceRollerNode::DiceRollerNode(qint64 max,qint64 min)
: m_max(max),m_diceResult(new DiceResult()),m_min(min)
: m_max(max),m_diceResult(new DiceResult()),m_min(min),m_operator(Die::PLUS)
{
m_result=m_diceResult;
}
Expand Down
7 changes: 0 additions & 7 deletions node/ifnode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,32 +59,25 @@ void IfNode::run(ExecutionNode *previous)
{
for(Die* dice : diceList)
{
qDebug()<< "dice value:" << dice->getValue();
if(m_validator->hasValid(dice,true,true))
{
qDebug()<< "true";
nextNode = (nullptr==m_true) ? nullptr: m_true->getCopy();
}
else
{
qDebug()<< "false";
nextNode = (nullptr==m_false) ? nullptr: m_false->getCopy();
}
qDebug()<< "dice value:" << dice->getValue() << "next node" << nextNode << "m_true" << m_true;

if(nullptr!=nextNode)
{
if(nullptr==previousLoop->getNextNode())
{
qDebug() << "iniside loop";
previousLoop->setNextNode(nextNode);
}
if(nullptr==m_nextNode)
{
qDebug() << "next node" ;
m_nextNode = nextNode;
}
qDebug() << "before run";
nextNode->run(previousLoop);
previousLoop = getLeafNode(nextNode);
}
Expand Down
1 change: 1 addition & 0 deletions result/diceresult.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <QDebug>

DiceResult::DiceResult()
: m_operator(Die::PLUS)
{
m_resultTypes= (DICE_LIST | SCALAR);
m_homogeneous = true;
Expand Down

0 comments on commit 91d8d76

Please sign in to comment.