aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/diceparser.cpp
diff options
context:
space:
mode:
authorRenaud G <renaud@rolisteam.org>2016-01-17 01:57:39 +0100
committerRenaud G <renaud@rolisteam.org>2016-01-17 01:57:39 +0100
commitc9df65aae8ca3234b5ec4abe08e687e1d2cd07bc (patch)
tree65605d2b5930d80c24d6aa9807c39e46a789c340 /diceparser.cpp
parent239051eff0ca6f28a4143c0f680c2600b2b0cb64 (diff)
parent7df15a3d41d87bbed9155a5cff2fda70acbf2f0e (diff)
downloadOneRoll-c9df65aae8ca3234b5ec4abe08e687e1d2cd07bc.tar.gz
OneRoll-c9df65aae8ca3234b5ec4abe08e687e1d2cd07bc.zip
Merge branch 'master' of github.com:Rolisteam/DiceParser
Diffstat (limited to 'diceparser.cpp')
-rw-r--r--diceparser.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/diceparser.cpp b/diceparser.cpp
index 796c3ce..7fcf267 100644
--- a/diceparser.cpp
+++ b/diceparser.cpp
@@ -38,6 +38,7 @@
#include "node/jumpbackwardnode.h"
#include "node/listsetrollnode.h"
#include "node/listaliasnode.h"
+#include "node/mergenode.h"
#define DEFAULT_FACES_NUMBER 10
@@ -445,7 +446,7 @@ QStringList DiceParser::getAllDiceResult(bool& hasAlias)
return stringListResult;
}
-void DiceParser::getLastDiceResult(ExportedDiceResult& diceValues)
+void DiceParser::getLastDiceResult(ExportedDiceResult& diceValues,bool& homogeneous)
{
ExecutionNode* next = getLeafNode();
Result* result=next->getResult();
@@ -457,6 +458,11 @@ void DiceParser::getLastDiceResult(ExportedDiceResult& diceValues)
DiceResult* diceResult = dynamic_cast<DiceResult*>(result);
if(NULL!=diceResult)
{
+ if(homogeneous)
+ {
+
+ homogeneous = diceResult->isHomogeneous();
+ }
quint64 face=0;
ListDiceResult listpair;
foreach(Die* die, diceResult->getResultList())
@@ -936,7 +942,16 @@ bool DiceParser::readOption(QString& str,ExecutionNode* previous, bool hasDice)/
m_errorMap.insert(ExecutionNode::BAD_SYNTAXE,QObject::tr("Validator is missing after the e operator. Please, change it"));
}
}
+ break;
+ case Merge:
+ {
+ MergeNode* mergeNode = new MergeNode();
+ previous->setNextNode(mergeNode);
+ node = mergeNode;
+ isFine = true;
+ }
+ break;
}
}