aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--diceresult.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/diceresult.cpp b/diceresult.cpp
index 015d759..6b60f9f 100644
--- a/diceresult.cpp
+++ b/diceresult.cpp
@@ -32,5 +32,15 @@ qint64 DiceResult::getScalar()
{
return m_diceValues[0]->getValue();
}
+ else
+ {
+ qint64 scalarSum = 0;
+ foreach(Die* die,m_diceValues)
+ {
+ scalarSum+=die->getValue();
+ }
+ return scalarSum;
+ }
+
return 0;
}