aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/node/scalaroperatornode.h
diff options
context:
space:
mode:
authorRenaud G <renaud@rolisteam.org>2013-12-29 02:04:19 +0100
committerRenaud G <renaud@rolisteam.org>2013-12-29 02:04:19 +0100
commitf30020384f816b498fe1f6013758a8de37811821 (patch)
tree7388de7fe766fe2973d94a3256f8820e3c7fbcdf /node/scalaroperatornode.h
parent7a1784893af6fe986503dc67672135ed05816579 (diff)
downloadOneRoll-f30020384f816b498fe1f6013758a8de37811821.tar.gz
OneRoll-f30020384f816b498fe1f6013758a8de37811821.zip
Firt commit of the new dice system for rolisteam.
Diffstat (limited to 'node/scalaroperatornode.h')
-rw-r--r--node/scalaroperatornode.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/node/scalaroperatornode.h b/node/scalaroperatornode.h
new file mode 100644
index 0000000..96324ba
--- /dev/null
+++ b/node/scalaroperatornode.h
@@ -0,0 +1,32 @@
+#ifndef SCALAROPERATORNODE_H
+#define SCALAROPERATORNODE_H
+
+#include <QMap>
+#include <QChar>
+
+#include "executionnode.h"
+
+
+class ScalarOperatorNode : public ExecutionNode
+{
+public:
+ enum ScalarOperator {PLUS,MINUS,DIVIDE,MULTIPLICATION};
+ ScalarOperatorNode();
+ virtual void run(ExecutionNode*);
+ bool setOperatorChar(QChar c);
+ void setInternalNode(ExecutionNode* node);
+
+
+private:
+ qint64 add(qint64,qint64);
+ qint64 substract(qint64,qint64);
+ qint64 divide(qint64,qint64);
+ qint64 multiple(qint64,qint64);
+
+private:
+ ScalarOperator m_myOperator;
+ ExecutionNode* m_internalNode;
+ QMap<QChar,ScalarOperator> m_scalarOperationList;
+};
+
+#endif // SCALAROPERATORNODE_H