aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/diceparser.cpp
diff options
context:
space:
mode:
authorRenaud G <renaud@rolisteam.org>2015-06-09 08:44:49 +0200
committerRenaud G <renaud@rolisteam.org>2015-06-09 08:44:49 +0200
commit2d9fe10724dc1d5de86e63670536b9a1b6599ba1 (patch)
tree5341bf5d7f7b3236cac12791ea547644302f987b /diceparser.cpp
parent88e5130bd86992819a036ef982733b5ee344d656 (diff)
downloadOneRoll-2d9fe10724dc1d5de86e63670536b9a1b6599ba1.tar.gz
OneRoll-2d9fe10724dc1d5de86e63670536b9a1b6599ba1.zip
-add method to read list with probability value. It sets range for all
values in List node.
Diffstat (limited to 'diceparser.cpp')
-rw-r--r--diceparser.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/diceparser.cpp b/diceparser.cpp
index 570c96b..4f0645e 100644
--- a/diceparser.cpp
+++ b/diceparser.cpp
@@ -555,9 +555,16 @@ bool DiceParser::readDice(QString& str,ExecutionNode* & node)
else if(currentOperator ==L)
{
QStringList list;
- if(m_parsingToolbox->readList(str,list))
+ QList<Range> listRange;
+ ParsingToolBox::LIST_OPERATOR op = m_parsingToolbox->readListOperator(str);
+ if(m_parsingToolbox->readList(str,list,listRange))
{
ListSetRollNode* lsrNode = new ListSetRollNode();
+ lsrNode->setRangeList(listRange);
+ if(op == ParsingToolBox::UNIQUE)
+ {
+ lsrNode->setUnique(true);
+ }
lsrNode->setListValue(list);
node = lsrNode;
return true;