aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/diceresult.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'diceresult.cpp')
-rw-r--r--diceresult.cpp33
1 files changed, 26 insertions, 7 deletions
diff --git a/diceresult.cpp b/diceresult.cpp
index f111ad4..7b73825 100644
--- a/diceresult.cpp
+++ b/diceresult.cpp
@@ -23,7 +23,7 @@
DiceResult::DiceResult()
{
-
+ m_resultTypes= (DICE_LIST | SCALAR);
}
void DiceResult::insertResult(Die* die)
{
@@ -38,17 +38,36 @@ void DiceResult::setResultList(QList<Die*> list)
m_diceValues.clear();
m_diceValues << list;
}
-bool DiceResult::isScalar() const
+//bool DiceResult::isScalar() const
+//{
+// if(m_diceValues.size()==1)
+// {
+// return true;
+// }
+// return false;
+//}
+QVariant DiceResult::getResult(RESULT_TYPE type)
{
- if(m_diceValues.size()==1)
+
+ switch (type)
+ {
+ case SCALAR:
+ return getScalarResult();
+ break;
+ case DICE_LIST:
{
- return true;
+
+ return QVariant();
+ break;
+ }
+ default:
+ break;
}
- return false;
+ return QVariant();
+
}
-qreal DiceResult::getScalar()
+qreal DiceResult::getScalarResult()
{
-
if(m_diceValues.size()==1)
{
return m_diceValues[0]->getValue();