aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/result
diff options
context:
space:
mode:
authorRenaud G <renaud@rolisteam.org>2016-01-17 01:57:39 +0100
committerRenaud G <renaud@rolisteam.org>2016-01-17 01:57:39 +0100
commitc9df65aae8ca3234b5ec4abe08e687e1d2cd07bc (patch)
tree65605d2b5930d80c24d6aa9807c39e46a789c340 /result
parent239051eff0ca6f28a4143c0f680c2600b2b0cb64 (diff)
parent7df15a3d41d87bbed9155a5cff2fda70acbf2f0e (diff)
downloadOneRoll-c9df65aae8ca3234b5ec4abe08e687e1d2cd07bc.tar.gz
OneRoll-c9df65aae8ca3234b5ec4abe08e687e1d2cd07bc.zip
Merge branch 'master' of github.com:Rolisteam/DiceParser
Diffstat (limited to 'result')
-rw-r--r--result/diceresult.cpp16
-rw-r--r--result/diceresult.h9
2 files changed, 24 insertions, 1 deletions
diff --git a/result/diceresult.cpp b/result/diceresult.cpp
index 74aa4e1..37db727 100644
--- a/result/diceresult.cpp
+++ b/result/diceresult.cpp
@@ -23,7 +23,8 @@
DiceResult::DiceResult()
{
- m_resultTypes= (DICE_LIST);
+ m_resultTypes= (DICE_LIST | SCALAR);
+ m_homogeneous = true;
}
void DiceResult::insertResult(Die* die)
{
@@ -33,6 +34,15 @@ QList<Die*>& DiceResult::getResultList()
{
return m_diceValues;
}
+bool DiceResult::isHomogeneous() const
+{
+ return m_homogeneous;
+}
+void DiceResult::setHomogeneous(bool b)
+{
+ m_homogeneous = b;
+}
+
void DiceResult::setResultList(QList<Die*> list)
{
qDeleteAll(m_diceValues.begin(), m_diceValues.end());
@@ -62,6 +72,10 @@ QVariant DiceResult::getResult(RESULT_TYPE type)
return QVariant();
}
+/*bool DiceResult::hasResultOfType(RESULT_TYPE type) const
+{
+ return (m_resultTypes & type);
+}*/
qreal DiceResult::getScalarResult()
{
if(m_diceValues.size()==1)
diff --git a/result/diceresult.h b/result/diceresult.h
index 84a4621..fe24277 100644
--- a/result/diceresult.h
+++ b/result/diceresult.h
@@ -66,11 +66,20 @@ public:
* @return
*/
virtual QString toString(bool wl);
+ /**
+ * @brief isHomogeneous
+ */
+ bool isHomogeneous() const;
+ /**
+ * @brief setHomogeneous
+ */
+ void setHomogeneous(bool);
private:
qreal getScalarResult();
private:
QList<Die*> m_diceValues;
+ bool m_homogeneous;
};
#endif // DICERESULT_H