aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/result/diceresult.cpp
diff options
context:
space:
mode:
authorRenaud G <renaud@rolisteam.org>2015-04-25 11:37:46 +0200
committerRenaud G <renaud@rolisteam.org>2015-04-25 11:37:46 +0200
commit5acfe8b8352ba028235e5ecf007d1b9b4fa3a0f8 (patch)
tree16738510451648bc33298f79ca54fd0574ad0602 /result/diceresult.cpp
parentea649ea152b7797782ef0345f16de7bcbcc34767 (diff)
downloadOneRoll-5acfe8b8352ba028235e5ecf007d1b9b4fa3a0f8.tar.gz
OneRoll-5acfe8b8352ba028235e5ecf007d1b9b4fa3a0f8.zip
Dot tree now also displays the result tree. (must be improved).
Diffstat (limited to 'result/diceresult.cpp')
-rw-r--r--result/diceresult.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/result/diceresult.cpp b/result/diceresult.cpp
index f87079a..95122f1 100644
--- a/result/diceresult.cpp
+++ b/result/diceresult.cpp
@@ -82,3 +82,12 @@ qreal DiceResult::getScalarResult()
return 0;
}
+QString DiceResult::toString()
+{
+ QStringList scalarSum;
+ foreach(Die* die,m_diceValues)
+ {
+ scalarSum << QString::number(die->getValue());
+ }
+ return QString("DiceResult_Value_%1_dice_%2").arg(getScalarResult()).arg(scalarSum.join('_'));
+}