aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/result
diff options
context:
space:
mode:
authorRenaud G <renaud@rolisteam.org>2018-12-08 21:14:43 +0100
committerRenaud G <renaud@rolisteam.org>2018-12-08 21:14:43 +0100
commitbb47c33763d250cc424216a1dd0fedefa80532a3 (patch)
tree3e60a84a8cd963d828299d49256ed6cd7c1bdd6f /result
parentb28b096d2fe3ddfed099ee8cc33c8caa504d7c83 (diff)
parent48de810db56b728726ec8b499b9a12c687b53795 (diff)
downloadOneRoll-bb47c33763d250cc424216a1dd0fedefa80532a3.tar.gz
OneRoll-bb47c33763d250cc424216a1dd0fedefa80532a3.zip
Merge branch 'master' of github.com:Rolisteam/DiceParser
Diffstat (limited to 'result')
-rw-r--r--result/diceresult.cpp5
-rw-r--r--result/diceresult.h1
2 files changed, 4 insertions, 2 deletions
diff --git a/result/diceresult.cpp b/result/diceresult.cpp
index 7894b60..c1089dd 100644
--- a/result/diceresult.cpp
+++ b/result/diceresult.cpp
@@ -114,6 +114,9 @@ qreal DiceResult::getScalarResult()
case Die::MINUS:
scalar-=tmp->getValue();
break;
+ case Die::POW:
+ scalar=static_cast<int>(pow(static_cast<double>(scalar),static_cast<double>(tmp->getValue())));
+ break;
case Die::DIVIDE:
case Die::INTEGER_DIVIDE:
if(tmp->getValue()!=0)
@@ -135,8 +138,6 @@ qreal DiceResult::getScalarResult()
}
return scalar;
}
-
- return 0;
}
Die::ArithmeticOperator DiceResult::getOperator() const
diff --git a/result/diceresult.h b/result/diceresult.h
index 8ff041f..8ea807a 100644
--- a/result/diceresult.h
+++ b/result/diceresult.h
@@ -22,6 +22,7 @@
#ifndef DICERESULT_H
#define DICERESULT_H
#include <QList>
+#include <functional>
#include "die.h"
#include "result.h"