From f30020384f816b498fe1f6013758a8de37811821 Mon Sep 17 00:00:00 2001 From: Renaud G Date: Sun, 29 Dec 2013 02:04:19 +0100 Subject: Firt commit of the new dice system for rolisteam. --- node/scalaroperatornode.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 node/scalaroperatornode.h (limited to 'node/scalaroperatornode.h') 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 +#include + +#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 m_scalarOperationList; +}; + +#endif // SCALAROPERATORNODE_H -- cgit v1.2.3-70-g09d2