aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/node
diff options
context:
space:
mode:
Diffstat (limited to 'node')
-rw-r--r--node/countexecutenode.cpp18
-rw-r--r--node/dicerollernode.cpp10
-rw-r--r--node/executionnode.cpp18
-rw-r--r--node/executionnode.h2
-rw-r--r--node/explosedicenode.cpp16
-rw-r--r--node/explosedicenode.h2
-rw-r--r--node/filternode.cpp14
-rw-r--r--node/helpnode.cpp8
-rw-r--r--node/ifnode.cpp42
-rw-r--r--node/ifnode.h2
-rw-r--r--node/jumpbackwardnode.cpp30
-rw-r--r--node/jumpbackwardnode.h2
-rw-r--r--node/keepdiceexecnode.cpp10
-rw-r--r--node/listaliasnode.cpp8
-rw-r--r--node/listaliasnode.h2
-rw-r--r--node/listsetrollnode.cpp12
-rw-r--r--node/listsetrollnode.h2
-rw-r--r--node/mergenode.cpp4
-rw-r--r--node/numbernode.cpp8
-rw-r--r--node/paintnode.cpp14
-rw-r--r--node/paintnode.h2
-rw-r--r--node/parenthesesnode.cpp20
-rw-r--r--node/parenthesesnode.h2
-rw-r--r--node/rerolldicenode.cpp16
-rw-r--r--node/scalaroperatornode.cpp32
-rw-r--r--node/sortresult.cpp12
-rw-r--r--node/splitnode.cpp8
-rw-r--r--node/startingnode.cpp8
-rw-r--r--node/stringnode.cpp8
29 files changed, 166 insertions, 166 deletions
diff --git a/node/countexecutenode.cpp b/node/countexecutenode.cpp
index 1f78fd2..84946df 100644
--- a/node/countexecutenode.cpp
+++ b/node/countexecutenode.cpp
@@ -4,7 +4,7 @@
CountExecuteNode::CountExecuteNode()
- : m_scalarResult(new ScalarResult()),m_validator(NULL)
+ : m_scalarResult(new ScalarResult()),m_validator(nullptr)
{
m_result = m_scalarResult;
}
@@ -14,7 +14,7 @@ void CountExecuteNode::setValidator(Validator* validator)
}
CountExecuteNode::~CountExecuteNode()
{
- if(NULL!=m_validator)
+ if(nullptr!=m_validator)
{
delete m_validator;
}
@@ -23,19 +23,19 @@ CountExecuteNode::~CountExecuteNode()
void CountExecuteNode::run(ExecutionNode *previous)
{
m_previousNode = previous;
- if(NULL==previous)
+ if(nullptr==previous)
{
return;
}
DiceResult* previousResult = dynamic_cast<DiceResult*>(previous->getResult());
- if(NULL!=previousResult)
+ if(nullptr!=previousResult)
{
m_result->setPrevious(previousResult);
QList<Die*> diceList=previousResult->getResultList();
qint64 sum = 0;
foreach(Die* dice,diceList)
{
- if(NULL!=m_validator)
+ if(nullptr!=m_validator)
{
sum+=m_validator->hasValid(dice,true,true);
}
@@ -43,7 +43,7 @@ void CountExecuteNode::run(ExecutionNode *previous)
m_scalarResult->setValue(sum);
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
m_nextNode->run(this);
}
@@ -63,7 +63,7 @@ QString CountExecuteNode::toString(bool withlabel) const
qint64 CountExecuteNode::getPriority() const
{
qint64 priority=0;
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
priority = m_nextNode->getPriority();
}
@@ -75,11 +75,11 @@ qint64 CountExecuteNode::getPriority() const
ExecutionNode* CountExecuteNode::getCopy() const
{
CountExecuteNode* node = new CountExecuteNode();
- if(NULL!=m_validator)
+ if(nullptr!=m_validator)
{
node->setValidator(m_validator->getCopy());
}
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
node->setNextNode(m_nextNode->getCopy());
}
diff --git a/node/dicerollernode.cpp b/node/dicerollernode.cpp
index 89ba24d..b6db419 100644
--- a/node/dicerollernode.cpp
+++ b/node/dicerollernode.cpp
@@ -17,10 +17,10 @@ DiceRollerNode::DiceRollerNode(qint64 max,qint64 min)
void DiceRollerNode::run(ExecutionNode* previous)
{
m_previousNode = previous;
- if(NULL!=previous)
+ if(nullptr!=previous)
{
Result* result=previous->getResult();
- if(NULL!=result)
+ if(nullptr!=result)
{
m_diceCount = result->getResult(Result::SCALAR).toReal();
m_result->setPrevious(result);
@@ -40,7 +40,7 @@ void DiceRollerNode::run(ExecutionNode* previous)
//qDebug() << die->getValue() << "value";
m_diceResult->insertResult(die);
}
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
m_nextNode->run(this);
}
@@ -66,7 +66,7 @@ QString DiceRollerNode::toString(bool wl) const
qint64 DiceRollerNode::getPriority() const
{
qint64 priority=4;
-// if(NULL!=m_nextNode)
+// if(nullptr!=m_nextNode)
// {
// priority = m_nextNode->getPriority();
// }
@@ -77,7 +77,7 @@ qint64 DiceRollerNode::getPriority() const
ExecutionNode* DiceRollerNode::getCopy() const
{
DiceRollerNode* node = new DiceRollerNode(m_max,m_min);
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
node->setNextNode(m_nextNode->getCopy());
}
diff --git a/node/executionnode.cpp b/node/executionnode.cpp
index c8c62f2..84aa17c 100644
--- a/node/executionnode.cpp
+++ b/node/executionnode.cpp
@@ -3,21 +3,21 @@
#include <QUuid>
ExecutionNode::ExecutionNode()
- : m_previousNode(NULL),m_result(NULL),m_nextNode(NULL),m_errors(QMap<ExecutionNode::DICE_ERROR_CODE,QString>()),m_id(QString("\"%1\"").arg(QUuid::createUuid().toString()))
+ : m_previousNode(nullptr),m_result(nullptr),m_nextNode(nullptr),m_errors(QMap<ExecutionNode::DICE_ERROR_CODE,QString>()),m_id(QString("\"%1\"").arg(QUuid::createUuid().toString()))
{
}
ExecutionNode::~ExecutionNode()
{
- if(NULL!=m_result)
+ if(nullptr!=m_result)
{
delete m_result;
- m_result = NULL;
+ m_result = nullptr;
}
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
delete m_nextNode;
- m_nextNode = NULL;
+ m_nextNode = nullptr;
}
}
@@ -39,7 +39,7 @@ ExecutionNode* ExecutionNode::getNextNode()
}
QMap<ExecutionNode::DICE_ERROR_CODE,QString> ExecutionNode::getExecutionErrorMap()
{
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
foreach (ExecutionNode::DICE_ERROR_CODE key, m_nextNode->getExecutionErrorMap().keys())
{
@@ -61,7 +61,7 @@ void ExecutionNode::generateDotTree(QString& s)
s.append(toString(true));
s.append(";\n");
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
s.append(toString(false));
s.append(" -> ");
@@ -74,8 +74,8 @@ void ExecutionNode::generateDotTree(QString& s)
{
s.append(toString(false));
s.append(" -> ");
- s.append("NULL;\n");
- if(NULL!=m_result)
+ s.append("nullptr;\n");
+ if(nullptr!=m_result)
{
s.append(toString(false));
diff --git a/node/executionnode.h b/node/executionnode.h
index c57b8b1..4913b68 100644
--- a/node/executionnode.h
+++ b/node/executionnode.h
@@ -23,7 +23,7 @@ public:
* @brief run
* @param previous
*/
- virtual void run(ExecutionNode* previous = NULL)=0;
+ virtual void run(ExecutionNode* previous = nullptr)=0;
/**
* @brief getResult
* @return
diff --git a/node/explosedicenode.cpp b/node/explosedicenode.cpp
index 51fc37e..96caaeb 100644
--- a/node/explosedicenode.cpp
+++ b/node/explosedicenode.cpp
@@ -1,18 +1,18 @@
#include "explosedicenode.h"
ExploseDiceNode::ExploseDiceNode()
- : m_diceResult(new DiceResult()),m_validator(NULL)
+ : m_diceResult(new DiceResult()),m_validator(nullptr)
{
m_result = m_diceResult;
}
void ExploseDiceNode::run(ExecutionNode* previous)
{
m_previousNode = previous;
- if((NULL!=previous)&&(NULL!=previous->getResult()))
+ if((nullptr!=previous)&&(nullptr!=previous->getResult()))
{
DiceResult* previous_result = static_cast<DiceResult*>(previous->getResult());
m_result->setPrevious(previous_result);
- if(NULL!=previous_result)
+ if(nullptr!=previous_result)
{
foreach(Die* die,previous_result->getResultList())
{
@@ -34,7 +34,7 @@ void ExploseDiceNode::run(ExecutionNode* previous)
}
// m_diceResult->setResultList(list);
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
m_nextNode->run(this);
}
@@ -43,7 +43,7 @@ void ExploseDiceNode::run(ExecutionNode* previous)
}
ExploseDiceNode::~ExploseDiceNode()
{
- if(NULL!=m_validator)
+ if(nullptr!=m_validator)
{
delete m_validator;
}
@@ -66,7 +66,7 @@ QString ExploseDiceNode::toString(bool withlabel) const
qint64 ExploseDiceNode::getPriority() const
{
qint64 priority=0;
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
priority = m_nextNode->getPriority();
}
@@ -78,11 +78,11 @@ qint64 ExploseDiceNode::getPriority() const
ExecutionNode* ExploseDiceNode::getCopy() const
{
ExploseDiceNode* node = new ExploseDiceNode();
- if(NULL!=m_validator)
+ if(nullptr!=m_validator)
{
node->setValidator(m_validator->getCopy());
}
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
node->setNextNode(m_nextNode->getCopy());
}
diff --git a/node/explosedicenode.h b/node/explosedicenode.h
index ceb35b8..6b582a3 100644
--- a/node/explosedicenode.h
+++ b/node/explosedicenode.h
@@ -14,7 +14,7 @@ class ExploseDiceNode : public ExecutionNode
public:
ExploseDiceNode();
virtual ~ExploseDiceNode();
- virtual void run(ExecutionNode* previous = NULL);
+ virtual void run(ExecutionNode* previous = nullptr);
virtual void setValidator(Validator* );
virtual QString toString(bool )const;
virtual qint64 getPriority() const;
diff --git a/node/filternode.cpp b/node/filternode.cpp
index 5cee9df..462774b 100644
--- a/node/filternode.cpp
+++ b/node/filternode.cpp
@@ -8,7 +8,7 @@ FilterNode::FilterNode()
FilterNode::~FilterNode()
{
- if(NULL!=m_validator)
+ if(nullptr!=m_validator)
{
delete m_validator;
}
@@ -20,13 +20,13 @@ void FilterNode::setValidator(Validator* validator)
void FilterNode::run(ExecutionNode* previous)
{
m_previousNode = previous;
- if(NULL==previous)
+ if(nullptr==previous)
{
return;
}
DiceResult* previousDiceResult = static_cast<DiceResult*>(previous->getResult());
m_result->setPrevious(previousDiceResult);
- if(NULL!=previousDiceResult)
+ if(nullptr!=previousDiceResult)
{
QList<Die*> diceList=previousDiceResult->getResultList();
QList<Die*> diceList2;
@@ -48,7 +48,7 @@ void FilterNode::run(ExecutionNode* previous)
}
m_diceResult->setResultList(diceList2);
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
m_nextNode->run(this);
}
@@ -69,7 +69,7 @@ QString FilterNode::toString(bool wl) const
qint64 FilterNode::getPriority() const
{
qint64 priority=0;
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
priority = m_nextNode->getPriority();
}
@@ -80,11 +80,11 @@ qint64 FilterNode::getPriority() const
ExecutionNode* FilterNode::getCopy() const
{
FilterNode* node = new FilterNode();
- if(NULL!=m_validator)
+ if(nullptr!=m_validator)
{
node->setValidator(m_validator->getCopy());
}
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
node->setNextNode(m_nextNode->getCopy());
}
diff --git a/node/helpnode.cpp b/node/helpnode.cpp
index 4425969..bcd7aaf 100644
--- a/node/helpnode.cpp
+++ b/node/helpnode.cpp
@@ -30,9 +30,9 @@ void HelpNode::run(ExecutionNode* previous)
StringResult* txtResult = dynamic_cast<StringResult*>(m_result);
txtResult->setHighLight(false);
- if(NULL != previous)
+ if(nullptr != previous)
{
- if(previous->getResult() == NULL)
+ if(previous->getResult() == nullptr)
{
txtResult->setText(QObject::tr("Rolisteam Dice Parser:\nFull documentation at: %1").arg(m_path));
}
@@ -43,7 +43,7 @@ void HelpNode::run(ExecutionNode* previous)
m_result->setPrevious(previous->getResult());
}
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
m_nextNode->run(this);
}
@@ -72,7 +72,7 @@ void HelpNode::setHelpPath(QString path)
ExecutionNode* HelpNode::getCopy() const
{
HelpNode* node = new HelpNode();
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
node->setNextNode(m_nextNode->getCopy());
}
diff --git a/node/ifnode.cpp b/node/ifnode.cpp
index c32a6a9..b40ed82 100644
--- a/node/ifnode.cpp
+++ b/node/ifnode.cpp
@@ -21,14 +21,14 @@
#include "result/diceresult.h"
IfNode::IfNode()
- : m_validator(NULL),m_true(NULL),m_false(NULL),m_conditionType(AllOfThem)
+ : m_validator(nullptr),m_true(nullptr),m_false(nullptr),m_conditionType(AllOfThem)
{
//m_result = new DiceResult();
}
IfNode::~IfNode()
{
- m_result=NULL;
+ m_result=nullptr;
}
void IfNode::run(ExecutionNode *previous)
@@ -104,29 +104,29 @@ void IfNode::run(ExecutionNode *previous)
{
if(oneIsTrue)
{
- nextNode = (NULL==m_true) ? NULL: m_true->getCopy();
+ nextNode = (nullptr==m_true) ? nullptr: m_true->getCopy();
}
else if(oneIsFalse)
{
- nextNode = (NULL==m_false) ? NULL: m_false->getCopy();
+ nextNode = (nullptr==m_false) ? nullptr: m_false->getCopy();
}
}
else if(m_conditionType==AllOfThem)
{
if(trueForAll)
{
- nextNode = (NULL==m_true) ? NULL: m_true->getCopy();
+ nextNode = (nullptr==m_true) ? nullptr: m_true->getCopy();
}
else if(falseForAll)
{
- nextNode = (NULL==m_false) ? NULL: m_false->getCopy();
+ nextNode = (nullptr==m_false) ? nullptr: m_false->getCopy();
}
}
- if(NULL!=nextNode)
+ if(nullptr!=nextNode)
{
- if(NULL==m_nextNode)
+ if(nullptr==m_nextNode)
{
m_nextNode = nextNode;
}
@@ -151,9 +151,9 @@ void IfNode::run(ExecutionNode *previous)
{
nextNode=m_false;
}
- if(NULL!=nextNode)
+ if(nullptr!=nextNode)
{
- if(NULL==m_nextNode)
+ if(nullptr==m_nextNode)
{
m_nextNode = nextNode;
}
@@ -163,7 +163,7 @@ void IfNode::run(ExecutionNode *previous)
}
}
- if((NULL!=m_nextNode)&&(runNext))
+ if((nullptr!=m_nextNode)&&(runNext))
{
m_nextNode->run(previousLoop);
}
@@ -187,7 +187,7 @@ void IfNode::generateDotTree(QString& s)
s.append(toString(true));
s.append(";\n");
- if((NULL!=m_true)&&(m_true != m_nextNode))
+ if((nullptr!=m_true)&&(m_true != m_nextNode))
{
s.append(toString(false));
s.append(" -> ");
@@ -196,7 +196,7 @@ void IfNode::generateDotTree(QString& s)
m_true->generateDotTree(s);
}
- if((NULL!=m_false)&&(m_false != m_nextNode))
+ if((nullptr!=m_false)&&(m_false != m_nextNode))
{
s.append(toString(false));
s.append(" -> ");
@@ -205,7 +205,7 @@ void IfNode::generateDotTree(QString& s)
m_false->generateDotTree(s);
}
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
s.append(toString(false));
s.append(" -> ");
@@ -217,9 +217,9 @@ void IfNode::generateDotTree(QString& s)
{
s.append(toString(false));
s.append(" -> ");
- s.append("NULL;\n");
+ s.append("nullptr;\n");
- if(NULL!=m_result)
+ if(nullptr!=m_result)
{
s.append(toString(false));
@@ -251,7 +251,7 @@ qint64 IfNode::getPriority() const
ExecutionNode* IfNode::getLeafNode(ExecutionNode* node)
{
ExecutionNode* next = node;
- while(NULL != next->getNextNode() )
+ while(nullptr != next->getNextNode() )
{
next = next->getNextNode();
}
@@ -270,19 +270,19 @@ void IfNode::setConditionType(const IfNode::ConditionType &conditionType)
ExecutionNode* IfNode::getCopy() const
{
IfNode* node = new IfNode();
- if(NULL!=m_validator)
+ if(nullptr!=m_validator)
{
node->setValidator(m_validator->getCopy());
}
- if(NULL!=m_false)
+ if(nullptr!=m_false)
{
node->setInstructionFalse(m_false->getCopy());
}
- if(NULL!=m_true)
+ if(nullptr!=m_true)
{
node->setInstructionTrue(m_true->getCopy());
}
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
node->setNextNode(m_nextNode->getCopy());
}
diff --git a/node/ifnode.h b/node/ifnode.h
index 7376101..9205000 100644
--- a/node/ifnode.h
+++ b/node/ifnode.h
@@ -47,7 +47,7 @@ public:
* @brief run
* @param previous
*/
- virtual void run(ExecutionNode* previous = NULL);
+ virtual void run(ExecutionNode* previous = nullptr);
/**
* @brief setValidator
*/
diff --git a/node/jumpbackwardnode.cpp b/node/jumpbackwardnode.cpp
index b7af106..1309b3b 100644
--- a/node/jumpbackwardnode.cpp
+++ b/node/jumpbackwardnode.cpp
@@ -23,8 +23,8 @@
JumpBackwardNode::JumpBackwardNode()
{
- m_previousNode=NULL;
- m_backwardNode = NULL;
+ m_previousNode=nullptr;
+ m_backwardNode = nullptr;
m_diceResult =new DiceResult();
m_result = m_diceResult;
}
@@ -51,7 +51,7 @@ void JumpBackwardNode::generateDotTree(QString& s)
s.append(toString(true));
s.append(";\n");
- if(NULL!=m_backwardNode)
+ if(nullptr!=m_backwardNode)
{
s.append(toString(false));
s.append(" -> ");
@@ -60,7 +60,7 @@ void JumpBackwardNode::generateDotTree(QString& s)
//m_backwardNode->generateDotTree(s);
}
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
s.append(toString(false));
s.append(" -> ");
@@ -72,9 +72,9 @@ void JumpBackwardNode::generateDotTree(QString& s)
{
s.append(toString(false));
s.append(" -> ");
- s.append("NULL;\n");
+ s.append("nullptr;\n");
- if(NULL!=m_result)
+ if(nullptr!=m_result)
{
s.append(toString(false));
s.append(" ->");
@@ -92,12 +92,12 @@ void JumpBackwardNode::run(ExecutionNode* previous)
ExecutionNode* parent = previous;
bool found=false;
//int i = 3;
- Result* result=NULL;
- while((NULL!=parent)&&(!found))
+ Result* result=nullptr;
+ while((nullptr!=parent)&&(!found))
{
result = parent->getResult();
- if(NULL!=result)
+ if(nullptr!=result)
{
//--i;
if(/*(i==0)&&*/(result->hasResultOfType(Result::DICE_LIST)))
@@ -108,7 +108,7 @@ void JumpBackwardNode::run(ExecutionNode* previous)
else
{
JumpBackwardNode* jpNode = dynamic_cast<JumpBackwardNode*>(parent);
- if(NULL!=jpNode)
+ if(nullptr!=jpNode)
{
found = true;
m_backwardNode = parent;
@@ -121,14 +121,14 @@ void JumpBackwardNode::run(ExecutionNode* previous)
}
}
- if(NULL==result)
+ if(nullptr==result)
{
m_errors.insert(DIE_RESULT_EXPECTED,QObject::tr(" The @ operator expects dice result. Please check the documentation to fix your command."));
}
else
{
DiceResult* diceResult = dynamic_cast<DiceResult*>(result);
- if(NULL!=diceResult)
+ if(nullptr!=diceResult)
{
foreach(Die* die,diceResult->getResultList())
{
@@ -141,11 +141,11 @@ void JumpBackwardNode::run(ExecutionNode* previous)
m_result->setPrevious(previous->getResult());
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
m_nextNode->run(this);
}
- if(NULL!=diceResult)
+ if(nullptr!=diceResult)
{
for(int i =0;i<diceResult->getResultList().size();++i)
{
@@ -163,7 +163,7 @@ void JumpBackwardNode::run(ExecutionNode* previous)
ExecutionNode* JumpBackwardNode::getCopy() const
{
JumpBackwardNode* node = new JumpBackwardNode();
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
node->setNextNode(m_nextNode->getCopy());
}
diff --git a/node/jumpbackwardnode.h b/node/jumpbackwardnode.h
index cb87181..eda71f1 100644
--- a/node/jumpbackwardnode.h
+++ b/node/jumpbackwardnode.h
@@ -37,7 +37,7 @@ public:
* @brief run - performs the actions
* @param previous
*/
- virtual void run(ExecutionNode* previous = NULL);
+ virtual void run(ExecutionNode* previous = nullptr);
/**
* @brief toString
diff --git a/node/keepdiceexecnode.cpp b/node/keepdiceexecnode.cpp
index d36abec..a93cc11 100644
--- a/node/keepdiceexecnode.cpp
+++ b/node/keepdiceexecnode.cpp
@@ -36,13 +36,13 @@ KeepDiceExecNode::~KeepDiceExecNode()
void KeepDiceExecNode::run(ExecutionNode* previous)
{
m_previousNode = previous;
- if(NULL==previous)
+ if(nullptr==previous)
{
return;
}
DiceResult* previousDiceResult = static_cast<DiceResult*>(previous->getResult());
m_result->setPrevious(previousDiceResult);
- if(NULL!=previousDiceResult)
+ if(nullptr!=previousDiceResult)
{
QList<Die*> diceList=previousDiceResult->getResultList();
@@ -70,7 +70,7 @@ void KeepDiceExecNode::run(ExecutionNode* previous)
}
m_diceResult->setResultList(diceList2);
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
m_nextNode->run(this);
}
@@ -94,7 +94,7 @@ QString KeepDiceExecNode::toString(bool wl) const
qint64 KeepDiceExecNode::getPriority() const
{
qint64 priority=0;
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
priority = m_nextNode->getPriority();
}
@@ -107,7 +107,7 @@ ExecutionNode* KeepDiceExecNode::getCopy() const
{
KeepDiceExecNode* node = new KeepDiceExecNode();
node->setDiceKeepNumber(m_numberOfDice);
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
node->setNextNode(m_nextNode->getCopy());
}
diff --git a/node/listaliasnode.cpp b/node/listaliasnode.cpp
index 91644d4..642f601 100644
--- a/node/listaliasnode.cpp
+++ b/node/listaliasnode.cpp
@@ -31,9 +31,9 @@ void ListAliasNode::run(ExecutionNode* previous )
StringResult* txtResult = dynamic_cast<StringResult*>(m_result);
txtResult->setHighLight(false);
- if(NULL != previous)
+ if(nullptr != previous)
{
- if(previous->getResult() == NULL)
+ if(previous->getResult() == nullptr)
{
txtResult->setText(buildList());
@@ -45,7 +45,7 @@ void ListAliasNode::run(ExecutionNode* previous )
m_result->setPrevious(previous->getResult());
}
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
m_nextNode->run(this);
}
@@ -84,7 +84,7 @@ qint64 ListAliasNode::getPriority() const
ExecutionNode* ListAliasNode::getCopy() const
{
ListAliasNode* node = new ListAliasNode(m_aliasList);
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
node->setNextNode(m_nextNode->getCopy());
}
diff --git a/node/listaliasnode.h b/node/listaliasnode.h
index 19212cd..493aa1e 100644
--- a/node/listaliasnode.h
+++ b/node/listaliasnode.h
@@ -36,7 +36,7 @@ public:
* @brief run
* @param previous
*/
- virtual void run(ExecutionNode* previous = NULL);
+ virtual void run(ExecutionNode* previous = nullptr);
/**
* @brief toString
diff --git a/node/listsetrollnode.cpp b/node/listsetrollnode.cpp
index 488721a..21d5403 100644
--- a/node/listsetrollnode.cpp
+++ b/node/listsetrollnode.cpp
@@ -28,10 +28,10 @@ ListSetRollNode::ListSetRollNode()
}
ListSetRollNode::~ListSetRollNode()
{
- if(NULL!=m_diceResult)
+ if(nullptr!=m_diceResult)
{
delete m_diceResult;
- m_diceResult =NULL;
+ m_diceResult =nullptr;
}
}
@@ -59,10 +59,10 @@ qint64 ListSetRollNode::getPriority() const
void ListSetRollNode::run(ExecutionNode* previous)
{
m_previousNode = previous;
- if(NULL!=previous)
+ if(nullptr!=previous)
{
Result* result=previous->getResult();
- if(NULL!=result)
+ if(nullptr!=result)
{
quint64 diceCount = result->getResult(Result::SCALAR).toReal();
m_result->setPrevious(result);
@@ -76,7 +76,7 @@ void ListSetRollNode::run(ExecutionNode* previous)
getValueFromDie(die,rollResult);
}
m_stringResult->setText(rollResult.join(","));
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
m_nextNode->run(this);
}
@@ -150,7 +150,7 @@ ExecutionNode* ListSetRollNode::getCopy() const
node->setRangeList(dataList);
node->setUnique(m_unique);
node->setListValue(m_values);
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
node->setNextNode(m_nextNode->getCopy());
}
diff --git a/node/listsetrollnode.h b/node/listsetrollnode.h
index c140d8d..2cc36f0 100644
--- a/node/listsetrollnode.h
+++ b/node/listsetrollnode.h
@@ -36,7 +36,7 @@ class ListSetRollNode : public ExecutionNode
public:
ListSetRollNode();
virtual ~ListSetRollNode();
- virtual void run(ExecutionNode* previous = NULL);
+ virtual void run(ExecutionNode* previous = nullptr);
virtual QString toString(bool)const;
virtual qint64 getPriority() const;
QStringList getList() const;
diff --git a/node/mergenode.cpp b/node/mergenode.cpp
index 1cf6062..f2323df 100644
--- a/node/mergenode.cpp
+++ b/node/mergenode.cpp
@@ -99,7 +99,7 @@ QString MergeNode::toString(bool withLabel) const
qint64 MergeNode::getPriority() const
{
qint64 priority=0;
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
priority = m_nextNode->getPriority();
}
@@ -108,7 +108,7 @@ qint64 MergeNode::getPriority() const
ExecutionNode* MergeNode::getCopy() const
{
MergeNode* node = new MergeNode();
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
node->setNextNode(m_nextNode->getCopy());
}
diff --git a/node/numbernode.cpp b/node/numbernode.cpp
index 5815ad6..26141c5 100644
--- a/node/numbernode.cpp
+++ b/node/numbernode.cpp
@@ -39,11 +39,11 @@ NumberNode::~NumberNode()
void NumberNode::run(ExecutionNode* previous)
{
m_previousNode = previous;
- if(NULL!=previous)
+ if(nullptr!=previous)
{
m_result->setPrevious(previous->getResult());
}
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
m_nextNode->run(this);
}
@@ -68,7 +68,7 @@ QString NumberNode::toString(bool withLabel) const
qint64 NumberNode::getPriority() const
{
qint64 priority=0;
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
priority = m_nextNode->getPriority();
}
@@ -80,7 +80,7 @@ ExecutionNode* NumberNode::getCopy() const
{
NumberNode* node = new NumberNode();
node->setNumber(m_number);
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
node->setNextNode(m_nextNode->getCopy());
}
diff --git a/node/paintnode.cpp b/node/paintnode.cpp
index 5a85590..2770891 100644
--- a/node/paintnode.cpp
+++ b/node/paintnode.cpp
@@ -53,28 +53,28 @@ void ColorItem::setColor(const QString &color)
PainterNode::PainterNode()
: ExecutionNode()
{
- m_result = NULL;
- m_nextNode = NULL;
+ m_result = nullptr;
+ m_nextNode = nullptr;
}
PainterNode::~PainterNode()
{
- m_result = NULL;
+ m_result = nullptr;
}
void PainterNode::run(ExecutionNode* previous)
{
m_previousNode = previous;
- if(NULL==previous)
+ if(nullptr==previous)
{
return;
}
Result* previousResult = previous->getResult();
//m_result = previousResult;
DiceResult* previousDiceResult = dynamic_cast<DiceResult*>(previousResult);
- if(NULL!=previousDiceResult)
+ if(nullptr!=previousDiceResult)
{
QList<Die*> diceList=previousDiceResult->getResultList();
int pastDice=0;
@@ -90,7 +90,7 @@ void PainterNode::run(ExecutionNode* previous)
}
}
}
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
m_nextNode->run(previous);
}
@@ -127,7 +127,7 @@ void PainterNode::insertColorItem(QString color, int value)
ExecutionNode* PainterNode::getCopy() const
{
PainterNode* node = new PainterNode();
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
node->setNextNode(m_nextNode->getCopy());
}
diff --git a/node/paintnode.h b/node/paintnode.h
index ffd8ae1..3d45b9a 100644
--- a/node/paintnode.h
+++ b/node/paintnode.h
@@ -48,7 +48,7 @@ class PainterNode : public ExecutionNode
public:
PainterNode();
virtual ~PainterNode();
- virtual void run(ExecutionNode* previous = NULL);
+ virtual void run(ExecutionNode* previous = nullptr);
Result* getResult();
virtual QString toString(bool )const;
virtual qint64 getPriority() const;
diff --git a/node/parenthesesnode.cpp b/node/parenthesesnode.cpp
index 96c0bb7..5c0379f 100644
--- a/node/parenthesesnode.cpp
+++ b/node/parenthesesnode.cpp
@@ -22,7 +22,7 @@
#include "parenthesesnode.h"
ParenthesesNode::ParenthesesNode()
- : m_internalNode(NULL)
+ : m_internalNode(nullptr)
{
}
@@ -32,12 +32,12 @@ void ParenthesesNode::setInternelNode(ExecutionNode* node)
}
void ParenthesesNode::run(ExecutionNode* /*previous*/)
{
- m_previousNode = NULL;
- if(NULL!=m_internalNode)
+ m_previousNode = nullptr;
+ if(nullptr!=m_internalNode)
{
m_internalNode->run(this);
ExecutionNode* temp=m_internalNode;
- while(NULL!=temp->getNextNode())
+ while(nullptr!=temp->getNextNode())
{
temp=temp->getNextNode();
}
@@ -45,7 +45,7 @@ void ParenthesesNode::run(ExecutionNode* /*previous*/)
}
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
m_nextNode->run(this);
}
@@ -69,11 +69,11 @@ qint64 ParenthesesNode::getPriority() const
ExecutionNode* ParenthesesNode::getCopy() const
{
ParenthesesNode* node = new ParenthesesNode();
- if(NULL!=m_internalNode)
+ if(nullptr!=m_internalNode)
{
node->setInternelNode(m_internalNode->getCopy());
}
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
node->setNextNode(m_nextNode->getCopy());
}
@@ -96,7 +96,7 @@ void ParenthesesNode::generateDotTree(QString & s)
}
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
s.append(toString(false));
s.append(" -> ");
@@ -109,8 +109,8 @@ void ParenthesesNode::generateDotTree(QString & s)
{
s.append(toString(false));
s.append(" -> ");
- s.append("NULL;\n");
- if(NULL!=m_result)
+ s.append("nullptr;\n");
+ if(nullptr!=m_result)
{
s.append(toString(false));
diff --git a/node/parenthesesnode.h b/node/parenthesesnode.h
index 388f6db..5f841ab 100644
--- a/node/parenthesesnode.h
+++ b/node/parenthesesnode.h
@@ -31,7 +31,7 @@ class ParenthesesNode : public ExecutionNode
{
public:
ParenthesesNode();
- virtual void run(ExecutionNode* previous = NULL);
+ virtual void run(ExecutionNode* previous = nullptr);
void setInternelNode(ExecutionNode* node);
virtual QString toString(bool)const;
diff --git a/node/rerolldicenode.cpp b/node/rerolldicenode.cpp
index dcce4aa..1f8cd7e 100644
--- a/node/rerolldicenode.cpp
+++ b/node/rerolldicenode.cpp
@@ -2,26 +2,26 @@
RerollDiceNode::RerollDiceNode()
- : m_diceResult(new DiceResult()),m_adding(false),m_validator(NULL)
+ : m_diceResult(new DiceResult()),m_adding(false),m_validator(nullptr)
{
m_result=m_diceResult;
}
RerollDiceNode::~RerollDiceNode()
{
- if(NULL!=m_validator)
+ if(nullptr!=m_validator)
{
delete m_validator;
- m_validator = NULL;
+ m_validator = nullptr;
}
}
void RerollDiceNode::run(ExecutionNode* previous)
{
m_previousNode = previous;
- if((NULL!=previous)&&(NULL!=previous->getResult()))
+ if((nullptr!=previous)&&(nullptr!=previous->getResult()))
{
DiceResult* previous_result = static_cast<DiceResult*>(previous->getResult());
m_result->setPrevious(previous_result);
- if(NULL!=previous_result)
+ if(nullptr!=previous_result)
{
foreach(Die* die,previous_result->getResultList())
{
@@ -42,7 +42,7 @@ void RerollDiceNode::run(ExecutionNode* previous)
}
}
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
m_nextNode->run(this);
}
@@ -72,7 +72,7 @@ void RerollDiceNode::setAddingMode(bool b)
qint64 RerollDiceNode::getPriority() const
{
qint64 priority=0;
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
priority = m_nextNode->getPriority();
}
@@ -85,7 +85,7 @@ ExecutionNode* RerollDiceNode::getCopy() const
RerollDiceNode* node = new RerollDiceNode();
node->setValidator(m_validator);
node->setAddingMode(m_adding);
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
node->setNextNode(m_nextNode->getCopy());
}
diff --git a/node/scalaroperatornode.cpp b/node/scalaroperatornode.cpp
index 9c86917..a9a19e3 100644
--- a/node/scalaroperatornode.cpp
+++ b/node/scalaroperatornode.cpp
@@ -26,7 +26,7 @@
ScalarOperatorNode::ScalarOperatorNode()
- : m_internalNode(NULL),m_scalarResult(new ScalarResult()),m_arithmeticOperator(Die::PLUS)
+ : m_internalNode(nullptr),m_scalarResult(new ScalarResult()),m_arithmeticOperator(Die::PLUS)
{
/*m_scalarOperationList.insert('+',PLUS);
m_scalarOperationList.insert('-',MINUS);
@@ -38,30 +38,30 @@ ScalarOperatorNode::ScalarOperatorNode()
}
ScalarOperatorNode::~ScalarOperatorNode()
{
- if(NULL!=m_internalNode)
+ if(nullptr!=m_internalNode)
{
delete m_internalNode;
- m_internalNode = NULL;
+ m_internalNode = nullptr;
}
}
void ScalarOperatorNode::run(ExecutionNode* previous)
{
m_previousNode = previous;
- if(NULL!=m_internalNode)
+ if(nullptr!=m_internalNode)
{
m_internalNode->run(this);
}
- if(NULL!=previous)
+ if(nullptr!=previous)
{
DiceResult* previousResult = static_cast<DiceResult*>(previous->getResult());
- if(NULL!=previousResult)
+ if(nullptr!=previousResult)
{
ExecutionNode* internal = m_internalNode;
- if(NULL != internal)
+ if(nullptr != internal)
{
- while(NULL != internal->getNextNode() )
+ while(nullptr != internal->getNextNode() )
{
internal = internal->getNextNode();
}
@@ -69,7 +69,7 @@ void ScalarOperatorNode::run(ExecutionNode* previous)
Result* internalResult = internal->getResult();
m_result->setPrevious(internalResult);
- if(NULL!=m_internalNode->getResult())
+ if(nullptr!=m_internalNode->getResult())
{
m_internalNode->getResult()->setPrevious(previousResult);
}
@@ -94,7 +94,7 @@ void ScalarOperatorNode::run(ExecutionNode* previous)
}
}
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
m_nextNode->run(this);
}
@@ -193,7 +193,7 @@ void ScalarOperatorNode::generateDotTree(QString& s)
s.append(toString(true));
s.append(";\n");
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
s.append(toString(false));
s.append(" -> ");
@@ -205,12 +205,12 @@ void ScalarOperatorNode::generateDotTree(QString& s)
{
s.append(toString(false));
s.append(" -> ");
- s.append("NULL");
+ s.append("nullptr");
s.append(" [label=\"nextNode\"];\n");
}
QString str;
str.append("\n");
- if(NULL!=m_internalNode)
+ if(nullptr!=m_internalNode)
{
str.append(toString(false));
str.append(" -> ");
@@ -222,14 +222,14 @@ void ScalarOperatorNode::generateDotTree(QString& s)
}
QMap<ExecutionNode::DICE_ERROR_CODE,QString> ScalarOperatorNode::getExecutionErrorMap()
{
- if(NULL!=m_internalNode)
+ if(nullptr!=m_internalNode)
{
for (ExecutionNode::DICE_ERROR_CODE key: m_internalNode->getExecutionErrorMap().keys())
{
m_errors.insert(key,m_internalNode->getExecutionErrorMap().value(key));
}
}
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
for (ExecutionNode::DICE_ERROR_CODE key: m_nextNode->getExecutionErrorMap().keys())
{
@@ -243,7 +243,7 @@ ExecutionNode* ScalarOperatorNode::getCopy() const
ScalarOperatorNode* node = new ScalarOperatorNode();
node->setInternalNode(m_internalNode->getCopy());
node->setArithmeticOperator(m_arithmeticOperator);
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
node->setNextNode(m_nextNode->getCopy());
}
diff --git a/node/sortresult.cpp b/node/sortresult.cpp
index d864aa2..5406eb6 100644
--- a/node/sortresult.cpp
+++ b/node/sortresult.cpp
@@ -34,13 +34,13 @@ SortResultNode::SortResultNode()
void SortResultNode::run(ExecutionNode* node)
{
m_previousNode = node;
- if(NULL==node)
+ if(nullptr==node)
{
return;
}
DiceResult* previousDiceResult = dynamic_cast<DiceResult*>(node->getResult());
m_diceResult->setPrevious(previousDiceResult);
- if(NULL!=previousDiceResult)
+ if(nullptr!=previousDiceResult)
{
QList<Die*> diceList=previousDiceResult->getResultList();
QList<Die*> diceList2=m_diceResult->getResultList();
@@ -57,7 +57,7 @@ void SortResultNode::run(ExecutionNode* node)
bool found = false;
int start = 0;
int end = diceList2.size();
- Die* tmp2 = NULL;
+ Die* tmp2 = nullptr;
while(!found)
{
int distance = end-start;
@@ -92,7 +92,7 @@ void SortResultNode::run(ExecutionNode* node)
}
m_diceResult->setResultList(diceList2);
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
m_nextNode->run(this);
}
@@ -123,7 +123,7 @@ QString SortResultNode::toString(bool wl) const
qint64 SortResultNode::getPriority() const
{
qint64 priority=0;
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
priority = m_nextNode->getPriority();
}
@@ -135,7 +135,7 @@ ExecutionNode* SortResultNode::getCopy() const
{
SortResultNode* node = new SortResultNode();
node->setSortAscending(m_ascending);
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
node->setNextNode(m_nextNode->getCopy());
}
diff --git a/node/splitnode.cpp b/node/splitnode.cpp
index a074248..ed32fdd 100644
--- a/node/splitnode.cpp
+++ b/node/splitnode.cpp
@@ -29,7 +29,7 @@ SplitNode::SplitNode()
void SplitNode::run(ExecutionNode* previous)
{
m_previousNode = previous;
- if(NULL!=previous)
+ if(nullptr!=previous)
{
m_result->setPrevious(previous->getResult());
@@ -56,7 +56,7 @@ void SplitNode::run(ExecutionNode* previous)
}
}
}
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
m_nextNode->run(this);
}
@@ -76,7 +76,7 @@ QString SplitNode::toString(bool withLabel) const
qint64 SplitNode::getPriority() const
{
qint64 priority=0;
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
priority = m_nextNode->getPriority();
}
@@ -85,7 +85,7 @@ qint64 SplitNode::getPriority() const
ExecutionNode* SplitNode::getCopy() const
{
SplitNode* node = new SplitNode();
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
node->setNextNode(m_nextNode->getCopy());
}
diff --git a/node/startingnode.cpp b/node/startingnode.cpp
index 3cd3352..670dc7d 100644
--- a/node/startingnode.cpp
+++ b/node/startingnode.cpp
@@ -26,8 +26,8 @@ StartingNode::StartingNode()
}
void StartingNode::run(ExecutionNode*)
{
- m_previousNode = NULL;
- if(NULL!=m_nextNode)
+ m_previousNode = nullptr;
+ if(nullptr!=m_nextNode)
{
m_nextNode->run(this);
}
@@ -48,7 +48,7 @@ QString StartingNode::toString(bool withlabel) const
qint64 StartingNode::getPriority() const
{
qint64 priority=0;
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
priority = m_nextNode->getPriority();
}
@@ -57,7 +57,7 @@ qint64 StartingNode::getPriority() const
ExecutionNode* StartingNode::getCopy() const
{
StartingNode* node = new StartingNode();
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
node->setNextNode(m_nextNode->getCopy());
}
diff --git a/node/stringnode.cpp b/node/stringnode.cpp
index d427cd6..af2fcda 100644
--- a/node/stringnode.cpp
+++ b/node/stringnode.cpp
@@ -9,11 +9,11 @@ StringNode::StringNode()
void StringNode::run(ExecutionNode *previous)
{
m_previousNode = previous;
- if(NULL!=previous)
+ if(nullptr!=previous)
{
m_result->setPrevious(previous->getResult());
}
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
m_nextNode->run(this);
}
@@ -111,7 +111,7 @@ QString StringNode::toString(bool withLabel) const
qint64 StringNode::getPriority() const
{
qint64 priority=0;
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
priority = m_nextNode->getPriority();
}
@@ -121,7 +121,7 @@ ExecutionNode* StringNode::getCopy() const
{
StringNode* node = new StringNode();
node->setString(m_data);
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
node->setNextNode(m_nextNode->getCopy());
}