aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/result
diff options
context:
space:
mode:
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"