summaryrefslogtreecommitdiffstats
path: root/libksirtet/lib/mp_simple_interface.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitc90c389a8a8d9d8661e9772ec4144c5cf2039f23 (patch)
tree6d8391395bce9eaea4ad78958617edb20c6a7573 /libksirtet/lib/mp_simple_interface.h
downloadtdegames-c90c389a8a8d9d8661e9772ec4144c5cf2039f23.tar.gz
tdegames-c90c389a8a8d9d8661e9772ec4144c5cf2039f23.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libksirtet/lib/mp_simple_interface.h')
-rw-r--r--libksirtet/lib/mp_simple_interface.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/libksirtet/lib/mp_simple_interface.h b/libksirtet/lib/mp_simple_interface.h
new file mode 100644
index 00000000..84e6f444
--- /dev/null
+++ b/libksirtet/lib/mp_simple_interface.h
@@ -0,0 +1,48 @@
+#ifndef MP_SIMPLE_INTERFACE_H
+#define MP_SIMPLE_INTERFACE_H
+
+#include "mp_interface.h"
+#include "mp_simple_types.h"
+
+class MPSimpleInterface : public MPInterface
+{
+ Q_OBJECT
+
+ public:
+ MPSimpleInterface(const MPGameInfo &gi,
+ uint nbActions, const ActionData *data,
+ QWidget *parent = 0, const char *name = 0);
+
+ bool isPaused() const { return state==SS_Pause; }
+
+ public slots:
+ void start();
+ void pause();
+ void addKeys(KKeyDialog &);
+
+ protected:
+ virtual void _init() = 0;
+ virtual void _readGameOverData(QDataStream &s) = 0;
+ virtual void _sendGameOverData(QDataStream &s) = 0;
+ virtual void _showGameOverData() = 0;
+ virtual void _firstInit() = 0;
+ virtual void _treatInit() = 0;
+ virtual bool _readPlayData() = 0;
+ virtual void _sendPlayData() = 0;
+
+ private:
+ ServerState state;
+ bool first_init;
+
+ void treatData();
+ void treatInit();
+ void treatPlay();
+ void treatPause(bool pause);
+ void treatStop();
+
+ void init();
+ void stop();
+ void dataFromServer(QDataStream &);
+};
+
+#endif // MP_SIMPLE_INTERFACE_H