1234567891011121314151617181920212223242526272829303132 |
- #ifndef MDD_MODULEMATH_H
- #define MDD_MODULEMATH_H
- #include "ModuleBase.h"
- namespace mdd {
- enum MathOperation {
- ADD = 1,
- SUBTRACT = 2,
- MULTIPLY = 3,
- DIVIDE = 4
- };
- class ModuleMath : public ModuleBase {
- private:
- MathOperation _operation;
- json add(const json &val1, const json &val2);
- json subtract(const json &val1, const json &val2);
- json multiply(const json &val1, const json &val2);
- json divide(const json &val1, const json &val2);
- public:
- explicit ModuleMath(MathOperation operation = ADD);
- void update() override;
- void setMathOperation(MathOperation operation);
- MathOperation getMathOperation();
- };
- }
- #endif
|