aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorobiwankennedy <renaud@rolisteam.org>2014-01-14 18:43:05 +0100
committerobiwankennedy <renaud@rolisteam.org>2014-01-14 18:43:05 +0100
commit02b524a7ff5ba793f65455b3766f93d5d8f0865d (patch)
tree8a63a8362aa1f2d23910e2cfa850a63813fee43b
parentbdd0f3eba5021e2a5b7fdfa0fbedf388a624b634 (diff)
downloadOneRoll-02b524a7ff5ba793f65455b3766f93d5d8f0865d.tar.gz
OneRoll-02b524a7ff5ba793f65455b3766f93d5d8f0865d.zip
Update diceresult.cpp
adding new scalar computation
-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;
}