From 6ba9324cf4864ebd2e2cdec8098b0889ceaea0a8 Mon Sep 17 00:00:00 2001 From: Renaud G Date: Sat, 16 Apr 2022 01:58:40 +0200 Subject: Make sure Windows compilation works --- result/diceresult.cpp | 18 +++++++++--------- result/diceresult.h | 7 ++++--- result/result.h | 2 +- 3 files changed, 14 insertions(+), 13 deletions(-) (limited to 'result') 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 -DiceResult::DiceResult() : m_operator(Die::PLUS) +DiceResult::DiceResult() { m_resultTypes= (static_cast(Dice::RESULT_TYPE::DICE_LIST) | static_cast(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(pow(static_cast(scalar), static_cast(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 #include +#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 equal); void clear() override; @@ -90,7 +91,7 @@ protected: protected: QList m_diceValues; bool m_homogeneous; - Die::ArithmeticOperator m_operator= Die::ArithmeticOperator::PLUS; + Dice::ArithmeticOperator m_operator{Dice::ArithmeticOperator::PLUS}; }; Q_DECLARE_METATYPE(QList) #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 #include +#include /** * @brief The Result class */ -- cgit v1.2.3-70-g09d2