aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorRobin Moussu <robin.moussu+git@gmail.com>2018-05-26 20:04:25 +0200
committerobiwankennedy <renaud@rolisteam.org>2018-06-01 13:51:59 +0200
commit00b6a6a04b341d5a6332083425e3524349cef521 (patch)
treedb53bd3f8532a702177458423fede3e3dd521f8e
parenta16c3814e81502f1ff97b68ecf8ab5498bca7095 (diff)
downloadOneRoll-00b6a6a04b341d5a6332083425e3524349cef521.tar.gz
OneRoll-00b6a6a04b341d5a6332083425e3524349cef521.zip
rename "exploSe" to "exploDe"
-rw-r--r--HelpMe.md4
-rw-r--r--README.md8
-rw-r--r--cli/CMakeLists.txt2
-rw-r--r--diceparser.cpp47
-rw-r--r--diceparser.h8
-rw-r--r--diceparser.pri4
-rw-r--r--irc/CMakeLists.txt2
-rw-r--r--mobile/CMakeLists.txt2
-rw-r--r--node/explodedicenode.cpp (renamed from node/explosedicenode.cpp)20
-rw-r--r--node/explodedicenode.h (renamed from node/explosedicenode.h)8
-rw-r--r--node/ifnode.h2
-rw-r--r--node/node.pri4
-rw-r--r--webserver/CMakeLists.txt2
13 files changed, 59 insertions, 54 deletions
diff --git a/HelpMe.md b/HelpMe.md
index c4f067f..5692285 100644
--- a/HelpMe.md
+++ b/HelpMe.md
@@ -487,7 +487,7 @@ The scalar value sets the validator on eguality between the dice value and the v
> 4d10e10
-This command means : roll 4 dice and they explose on 10.
+This command means : roll 4 dice and they explode on 10.
### Range
@@ -535,7 +535,7 @@ Roll 3 dice with 100 faces
> 10D10e[=10]s
-Roll 10 dice with 10 faces, 10 exploses, and sort the result.
+Roll 10 dice with 10 faces, 10 explodes, and sort the result.
> 100291D66666666s
diff --git a/README.md b/README.md
index c23ea6c..8ea3407 100644
--- a/README.md
+++ b/README.md
@@ -14,7 +14,7 @@ Instruction =: Expression
Expression =: number | number Dice DiceOperation | ScalarOperator Expression | string | variable Expression
Dice =: DiceOperator Number(faces) | DiceOperator ListOfValues
DiceOperator =: D | L
-DiceOperation =: Keep | KeepAndExplose | Sort | Count | Reroll | If | Explose | RerollAndAdd | Jumpbackward | Merge | Filter | Split | Parenthese | Count | Paint | Group
+DiceOperation =: Keep | KeepAndExplode | Sort | Count | Reroll | If | Explode | Jumpbackward | Merge | Filter | Split | Parenthese | Count | Paint | Group
ScalarOperator =: [x,-,*,x,/]
number =: [0-9]+ | constantValue
constantValue =: ${id | label}
@@ -29,7 +29,7 @@ BooleanValidator =: number | [operator number] |
ListOfValue=: String[Range],ListOfValue | String[Range]
String =: [A-z0-9]+
Keep =: k Number
-KeepAndExplose =: K number
+KeepAndExplode =: K number
Reroll =: r
Explosing =: e
RerollOnceAndAdd =: a
@@ -41,7 +41,7 @@ Sort =: s
If =: i compareMethod [Validator] {Expression}[{Expression}]
Paint =: p [ Count : color ]
Group =: number
-Explose =: e Validator
+Explode =: e Validator
Jumpbackward =: @DiceOperation
Merge =: m | m Expression
Filter =: f Validator
@@ -57,7 +57,7 @@ Count =: c Validator
Roll 3 dice with 100 faces
### 10D10e[=10]s
-Roll 10 dice with 10 faces, 10 exploses, and sort the result.
+Roll 10 dice with 10 faces, 10 explodes, and sort the result.
### 100291D66666666s
roll 100291 dice with 66666666666 faces and sort result
diff --git a/cli/CMakeLists.txt b/cli/CMakeLists.txt
index 748410c..4a085a3 100644
--- a/cli/CMakeLists.txt
+++ b/cli/CMakeLists.txt
@@ -80,7 +80,7 @@ SET( dice_sources
../node/countexecutenode.cpp
../node/dicerollernode.cpp
../node/executionnode.cpp
- ../node/explosedicenode.cpp
+ ../node/explodedicenode.cpp
../node/helpnode.cpp
../node/mergenode.cpp
../node/jumpbackwardnode.cpp
diff --git a/diceparser.cpp b/diceparser.cpp
index 713864a..c37d572 100644
--- a/diceparser.cpp
+++ b/diceparser.cpp
@@ -33,7 +33,7 @@
#include "node/sortresult.h"
#include "node/countexecutenode.h"
#include "node/rerolldicenode.h"
-#include "node/explosedicenode.h"
+#include "node/explodedicenode.h"
#include "node/parenthesesnode.h"
#include "node/helpnode.h"
#include "node/jumpbackwardnode.h"
@@ -64,11 +64,11 @@ DiceParser::DiceParser()
m_OptionOp = new QMap<QString,OptionOperator>();
m_OptionOp->insert(QStringLiteral("k"),Keep);
- m_OptionOp->insert(QStringLiteral("K"),KeepAndExplose);
+ m_OptionOp->insert(QStringLiteral("K"),KeepAndExplode);
m_OptionOp->insert(QStringLiteral("s"),Sort);
m_OptionOp->insert(QStringLiteral("c"),Count);
m_OptionOp->insert(QStringLiteral("r"),Reroll);
- m_OptionOp->insert(QStringLiteral("e"),Explosing);
+ m_OptionOp->insert(QStringLiteral("e"),Explode);
m_OptionOp->insert(QStringLiteral("a"),RerollAndAdd);
m_OptionOp->insert(QStringLiteral("m"),Merge);
m_OptionOp->insert(QStringLiteral("i"),ifOperator);
@@ -921,18 +921,18 @@ DiceRollerNode* DiceParser::addRollDiceNode(qint64 faces,ExecutionNode* previous
previous->setNextNode(mydiceRoller);
return mydiceRoller;
}
-ExploseDiceNode* DiceParser::addExploseDiceNode(qint64 value,ExecutionNode* previous)
+ExplodeDiceNode* DiceParser::addExplodeDiceNode(qint64 value,ExecutionNode* previous)
{
- ExploseDiceNode* exploseDiceNode= new ExploseDiceNode();
+ ExplodeDiceNode* explodeDiceNode= new ExplodeDiceNode();
NumberNode* node = new NumberNode();
node->setNumber(value);
BooleanCondition* condition = new BooleanCondition();
condition->setValueNode(node);
condition->setOperator(BooleanCondition::Equal);
m_parsingToolbox->isValidValidator(previous,condition);
- exploseDiceNode->setValidator(condition);
- previous->setNextNode(exploseDiceNode);
- return exploseDiceNode;
+ explodeDiceNode->setValidator(condition);
+ previous->setNextNode(explodeDiceNode);
+ return explodeDiceNode;
}
bool DiceParser::readOption(QString& str,ExecutionNode* previous)//,
{
@@ -946,13 +946,13 @@ bool DiceParser::readOption(QString& str,ExecutionNode* previous)//,
for(int i = 0; ((i<m_OptionOp->keys().size())&&(!found));++i )
{
- QString tmp =m_OptionOp->keys().at(i);
+ QString key =m_OptionOp->keys().at(i);
- if(str.startsWith(tmp))
+ if(str.startsWith(key))
{
- str=str.remove(0,tmp.size());
- auto operatorName = m_OptionOp->value(tmp);
+ str=str.remove(0,key.size());
+ auto operatorName = m_OptionOp->value(key);
switch(operatorName)
{
case Keep:
@@ -972,7 +972,7 @@ bool DiceParser::readOption(QString& str,ExecutionNode* previous)//,
}
}
break;
- case KeepAndExplose:
+ case KeepAndExplode:
{
qint64 myNumber=0;
bool ascending = m_parsingToolbox->readAscending(str);
@@ -986,7 +986,7 @@ bool DiceParser::readOption(QString& str,ExecutionNode* previous)//,
if(nullptr!=nodeTmp)
{
- previous = addExploseDiceNode(nodeTmp->getFaces(),previous);
+ previous = addExplodeDiceNode(nodeTmp->getFaces(),previous);
}
node = m_parsingToolbox->addSort(previous,ascending);
@@ -1064,7 +1064,7 @@ bool DiceParser::readOption(QString& str,ExecutionNode* previous)//,
{
rerollNode->setInstruction(nodeParam);
}
- if(m_OptionOp->value(tmp)==RerollAndAdd)
+ if(m_OptionOp->value(key)==RerollAndAdd)
{
rerollNode->setAddingMode(true);
}
@@ -1076,12 +1076,17 @@ bool DiceParser::readOption(QString& str,ExecutionNode* previous)//,
}
else
{
- m_errorMap.insert(ExecutionNode::BAD_SYNTAXE,QObject::tr("Validator is missing after the %1 operator. Please, change it").arg(m_OptionOp->value(tmp)==Reroll?QStringLiteral("r"):QStringLiteral("a")));
+ m_errorMap.insert(ExecutionNode::BAD_SYNTAXE,
+ QObject::tr("Validator is missing after the %1 operator. Please, change it")
+ .arg(operatorName==Reroll? QStringLiteral("r")
+ :operatorName==RerollUntil? QStringLiteral("R")
+ :operatorName==RerollAndAdd? QStringLiteral("a")
+ :""));
}
}
break;
- case Explosing:
+ case Explode:
{
Validator* validator = m_parsingToolbox->readCompositeValidator(str);
if(nullptr!=validator)
@@ -1090,10 +1095,10 @@ bool DiceParser::readOption(QString& str,ExecutionNode* previous)//,
{
m_errorMap.insert(ExecutionNode::ENDLESS_LOOP_ERROR,QObject::tr("This condition %1 introduces an endless loop. Please, change it").arg(validator->toString()));
}
- ExploseDiceNode* explosedNode = new ExploseDiceNode();
- explosedNode->setValidator(validator);
- previous->setNextNode(explosedNode);
- node = explosedNode;
+ ExplodeDiceNode* explodedNode = new ExplodeDiceNode();
+ explodedNode->setValidator(validator);
+ previous->setNextNode(explodedNode);
+ node = explodedNode;
found = true;
}
diff --git a/diceparser.h b/diceparser.h
index c3b5be2..eed2d06 100644
--- a/diceparser.h
+++ b/diceparser.h
@@ -38,7 +38,7 @@
typedef QList<HighLightDice > ListDiceResult;
typedef QMap<int,ListDiceResult > ExportedDiceResult;
-class ExploseDiceNode;
+class ExplodeDiceNode;
/**
* @page DiceParser Dice Parser
*
@@ -68,7 +68,7 @@ public:
/**
* @brief The OptionOperator enum gathering all options availables for result.
*/
- enum OptionOperator {KeepAndExplose,Keep,Reroll,Explosing,Sort,Count,RerollAndAdd,Merge,ifOperator,Painter,Filter,Split,Group};
+ enum OptionOperator {KeepAndExplode,Keep,Reroll,RerollUntil,Explode,Sort,Count,RerollAndAdd,Merge,ifOperator,Painter,Filter,Split,Group};
/**
* @brief The CommandOperator enum
*/
@@ -265,12 +265,12 @@ private:
*/
DiceRollerNode* addRollDiceNode(qint64 faces,ExecutionNode*);
/**
- * @brief addExploseDiceNode
+ * @brief addExplodeDiceNode
* @param faces
* @param previous
* @return
*/
- ExploseDiceNode* addExploseDiceNode(qint64 faces,ExecutionNode* previous);
+ ExplodeDiceNode* addExplodeDiceNode(qint64 faces,ExecutionNode* previous);
/**
* @brief readOperand
* @param node
diff --git a/diceparser.pri b/diceparser.pri
index b522965..22bcb30 100644
--- a/diceparser.pri
+++ b/diceparser.pri
@@ -29,7 +29,7 @@ SOURCES += $$PWD/diceparser.cpp \
$$PWD/node/sortresult.cpp \
$$PWD/node/keepdiceexecnode.cpp \
$$PWD/node/countexecutenode.cpp \
- $$PWD/node/explosedicenode.cpp \
+ $$PWD/node/explodedicenode.cpp \
$$PWD/node/parenthesesnode.cpp \
$$PWD/node/helpnode.cpp \
$$PWD/node/jumpbackwardnode.cpp \
@@ -72,7 +72,7 @@ HEADERS += \
$$PWD/node/sortresult.h \
$$PWD/node/keepdiceexecnode.h \
$$PWD/node/countexecutenode.h \
- $$PWD/node/explosedicenode.h \
+ $$PWD/node/explodedicenode.h \
$$PWD/node/parenthesesnode.h \
$$PWD/node/helpnode.h \
$$PWD/node/jumpbackwardnode.h \
diff --git a/irc/CMakeLists.txt b/irc/CMakeLists.txt
index ce71373..6970005 100644
--- a/irc/CMakeLists.txt
+++ b/irc/CMakeLists.txt
@@ -53,7 +53,7 @@ add_executable(
../node/countexecutenode.cpp
../node/dicerollernode.cpp
../node/executionnode.cpp
- ../node/explosedicenode.cpp
+ ../node/explodedicenode.cpp
../node/helpnode.cpp
../node/mergenode.cpp
../node/jumpbackwardnode.cpp
diff --git a/mobile/CMakeLists.txt b/mobile/CMakeLists.txt
index ed4259a..7dcfdef 100644
--- a/mobile/CMakeLists.txt
+++ b/mobile/CMakeLists.txt
@@ -73,7 +73,7 @@ SET( diceGui_sources
../node/countexecutenode.cpp
../node/dicerollernode.cpp
../node/executionnode.cpp
- ../node/explosedicenode.cpp
+ ../node/explodedicenode.cpp
../node/helpnode.cpp
../node/mergenode.cpp
../node/jumpbackwardnode.cpp
diff --git a/node/explosedicenode.cpp b/node/explodedicenode.cpp
index f818294..d640eaa 100644
--- a/node/explosedicenode.cpp
+++ b/node/explodedicenode.cpp
@@ -1,11 +1,11 @@
-#include "explosedicenode.h"
+#include "explodedicenode.h"
-ExploseDiceNode::ExploseDiceNode()
+ExplodeDiceNode::ExplodeDiceNode()
: m_diceResult(new DiceResult()),m_validator(nullptr)
{
m_result = m_diceResult;
}
-void ExploseDiceNode::run(ExecutionNode* previous)
+void ExplodeDiceNode::run(ExecutionNode* previous)
{
m_previousNode = previous;
if((nullptr!=previous)&&(nullptr!=previous->getResult()))
@@ -44,29 +44,29 @@ void ExploseDiceNode::run(ExecutionNode* previous)
}
}
}
-ExploseDiceNode::~ExploseDiceNode()
+ExplodeDiceNode::~ExplodeDiceNode()
{
if(nullptr!=m_validator)
{
delete m_validator;
}
}
-void ExploseDiceNode::setValidator(Validator* val)
+void ExplodeDiceNode::setValidator(Validator* val)
{
m_validator = val;
}
-QString ExploseDiceNode::toString(bool withlabel) const
+QString ExplodeDiceNode::toString(bool withlabel) const
{
if(withlabel)
{
- return QString("%1 [label=\"ExploseDiceNode %2\"]").arg(m_id).arg(m_validator->toString());
+ return QString("%1 [label=\"ExplodeDiceNode %2\"]").arg(m_id).arg(m_validator->toString());
}
else
{
return m_id;
}
}
-qint64 ExploseDiceNode::getPriority() const
+qint64 ExplodeDiceNode::getPriority() const
{
qint64 priority=0;
if(nullptr!=m_previousNode)
@@ -76,9 +76,9 @@ qint64 ExploseDiceNode::getPriority() const
return priority;
}
-ExecutionNode* ExploseDiceNode::getCopy() const
+ExecutionNode* ExplodeDiceNode::getCopy() const
{
- ExploseDiceNode* node = new ExploseDiceNode();
+ ExplodeDiceNode* node = new ExplodeDiceNode();
if(nullptr!=m_validator)
{
node->setValidator(m_validator->getCopy());
diff --git a/node/explosedicenode.h b/node/explodedicenode.h
index 6b582a3..feea86f 100644
--- a/node/explosedicenode.h
+++ b/node/explodedicenode.h
@@ -7,13 +7,13 @@
#include <QDebug>
/**
- * @brief The ExploseDiceNode class explose dice while is valid by the validator.
+ * @brief The ExplodeDiceNode class explode dice while is valid by the validator.
*/
-class ExploseDiceNode : public ExecutionNode
+class ExplodeDiceNode : public ExecutionNode
{
public:
- ExploseDiceNode();
- virtual ~ExploseDiceNode();
+ ExplodeDiceNode();
+ virtual ~ExplodeDiceNode();
virtual void run(ExecutionNode* previous = nullptr);
virtual void setValidator(Validator* );
virtual QString toString(bool )const;
diff --git a/node/ifnode.h b/node/ifnode.h
index 9205000..29fcec3 100644
--- a/node/ifnode.h
+++ b/node/ifnode.h
@@ -26,7 +26,7 @@
#include <QDebug>
/**
- * @brief The ifNode class explose dice while is valid by the validator.
+ * @brief The ifNode class explode dice while is valid by the validator.
*/
class IfNode : public ExecutionNode
{
diff --git a/node/node.pri b/node/node.pri
index 1814a5d..6cf7005 100644
--- a/node/node.pri
+++ b/node/node.pri
@@ -8,7 +8,7 @@ HEADERS += \
$$PWD/sortresult.h \
$$PWD/keepdiceexecnode.h \
$$PWD/countexecutenode.h \
- $$PWD/explosedicenode.h \
+ $$PWD/explodedicenode.h \
$$PWD/parenthesesnode.h \
$$PWD/helpnode.h \
$$PWD/jumpbackwardnode.h \
@@ -25,7 +25,7 @@ SOURCES += \
$$PWD/sortresult.cpp \
$$PWD/keepdiceexecnode.cpp \
$$PWD/countexecutenode.cpp \
- $$PWD/explosedicenode.cpp \
+ $$PWD/explodedicenode.cpp \
$$PWD/parenthesesnode.cpp \
$$PWD/helpnode.cpp \
$$PWD/jumpbackwardnode.cpp \
diff --git a/webserver/CMakeLists.txt b/webserver/CMakeLists.txt
index 7bfa2d2..73aaf9b 100644
--- a/webserver/CMakeLists.txt
+++ b/webserver/CMakeLists.txt
@@ -47,7 +47,7 @@ SET( diceserver_sources
../node/countexecutenode.cpp
../node/dicerollernode.cpp
../node/executionnode.cpp
- ../node/explosedicenode.cpp
+ ../node/explodedicenode.cpp
../node/helpnode.cpp
../node/mergenode.cpp
../node/jumpbackwardnode.cpp