aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/result
diff options
context:
space:
mode:
authorRenaud G <renaud@rolisteam.org>2022-04-16 01:58:40 +0200
committerRenaud G <renaud@rolisteam.org>2022-04-16 02:59:30 +0200
commit6ba9324cf4864ebd2e2cdec8098b0889ceaea0a8 (patch)
treee29af0f803de724e28eab85da2dfe6c535a8292b /result
parent0c040da59e6aa2df3bd0c22e38b2afe0512d3749 (diff)
downloadOneRoll-6ba9324cf4864ebd2e2cdec8098b0889ceaea0a8.tar.gz
OneRoll-6ba9324cf4864ebd2e2cdec8098b0889ceaea0a8.zip
Make sure Windows compilation works
Diffstat (limited to 'result')
-rw-r--r--result/diceresult.cpp18
-rw-r--r--result/diceresult.h7
-rw-r--r--result/result.h2
3 files changed, 14 insertions, 13 deletions
diff --git a/result/diceresult.cpp b/result/diceresult.cpp
index 2f13210..31e316b 100644
--- a/result/diceresult.cpp
+++ b/result/diceresult.cpp
@@ -23,7 +23,7 @@
#include "diceresult.h"
#include <QDebug>
-DiceResult::DiceResult() : m_operator(Die::PLUS)
+DiceResult::DiceResult()
{
m_resultTypes= (static_cast<int>(Dice::RESULT_TYPE::DICE_LIST) | static_cast<int>(Dice::RESULT_TYPE::SCALAR));
m_homogeneous= true;
@@ -107,20 +107,20 @@ qreal DiceResult::getScalarResult()
{
switch(m_operator)
{
- case Die::PLUS:
+ case Dice::ArithmeticOperator::PLUS:
scalar+= tmp->getValue();
break;
- case Die::MULTIPLICATION:
+ case Dice::ArithmeticOperator::MULTIPLICATION:
scalar*= tmp->getValue();
break;
- case Die::MINUS:
+ case Dice::ArithmeticOperator::MINUS:
scalar-= tmp->getValue();
break;
- case Die::POW:
+ case Dice::ArithmeticOperator::POW:
scalar= static_cast<int>(pow(static_cast<double>(scalar), static_cast<double>(tmp->getValue())));
break;
- case Die::DIVIDE:
- case Die::INTEGER_DIVIDE:
+ case Dice::ArithmeticOperator::DIVIDE:
+ case Dice::ArithmeticOperator::INTEGER_DIVIDE:
if(tmp->getValue() != 0)
{
scalar/= tmp->getValue();
@@ -142,7 +142,7 @@ qreal DiceResult::getScalarResult()
}
}
-Die::ArithmeticOperator DiceResult::getOperator() const
+Dice::ArithmeticOperator DiceResult::getOperator() const
{
return m_operator;
}
@@ -152,7 +152,7 @@ void DiceResult::clear()
m_diceValues.clear();
}
-void DiceResult::setOperator(const Die::ArithmeticOperator& dieOperator)
+void DiceResult::setOperator(const Dice::ArithmeticOperator& dieOperator)
{
m_operator= dieOperator;
}
diff --git a/result/diceresult.h b/result/diceresult.h
index 8f15d3b..1b35b7e 100644
--- a/result/diceresult.h
+++ b/result/diceresult.h
@@ -24,6 +24,7 @@
#include <QList>
#include <functional>
+#include "diceparser/diceparserhelper.h"
#include "die.h"
#include "result.h"
/**
@@ -76,8 +77,8 @@ public:
*/
virtual void setHomogeneous(bool);
- Die::ArithmeticOperator getOperator() const;
- void setOperator(const Die::ArithmeticOperator& dieOperator);
+ Dice::ArithmeticOperator getOperator() const;
+ void setOperator(const Dice::ArithmeticOperator& dieOperator);
bool contains(Die* die, const std::function<bool(const Die*, const Die*)> equal);
void clear() override;
@@ -90,7 +91,7 @@ protected:
protected:
QList<Die*> m_diceValues;
bool m_homogeneous;
- Die::ArithmeticOperator m_operator= Die::ArithmeticOperator::PLUS;
+ Dice::ArithmeticOperator m_operator{Dice::ArithmeticOperator::PLUS};
};
Q_DECLARE_METATYPE(QList<Die*>)
#endif // DICERESULT_H
diff --git a/result/result.h b/result/result.h
index e86ed1f..4432682 100644
--- a/result/result.h
+++ b/result/result.h
@@ -22,9 +22,9 @@
#ifndef RESULT_H
#define RESULT_H
-#include "diceparserhelper.h"
#include <QString>
#include <QVariant>
+#include <diceparser/diceparserhelper.h>
/**
* @brief The Result class
*/