summaryrefslogtreecommitdiffstats
path: root/libksirtet/common/inter.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/common/inter.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/common/inter.h')
-rw-r--r--libksirtet/common/inter.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/libksirtet/common/inter.h b/libksirtet/common/inter.h
new file mode 100644
index 00000000..e38c2ed5
--- /dev/null
+++ b/libksirtet/common/inter.h
@@ -0,0 +1,62 @@
+#ifndef COMMON_INTER_H
+#define COMMON_INTER_H
+
+#include <kexthighscore.h>
+#include "lib/libksirtet_export.h"
+
+#include "lib/mp_simple_interface.h"
+#include "base/inter.h"
+#include "types.h"
+#include "board.h"
+
+
+class Field;
+
+class LIBKSIRTET_EXPORT Interface : public MPSimpleInterface, public BaseInterface
+{
+ Q_OBJECT
+public:
+ Interface(const MPGameInfo &, QWidget *parent);
+
+signals:
+ void settingsChanged();
+
+public slots:
+ void normalGame();
+ void arcadeGame();
+ void settingsChangedSlot() { emit settingsChanged(); }
+
+protected:
+ void _showHighscores(QWidget *parent);
+
+private:
+ QMemArray<ClientPlayData> _data;
+ KExtHighscore::Score _score;
+ KExtHighscore::MultiplayerScores _scores;
+ Field *_firstField;
+
+ enum Action { Nb_Actions = 8 };
+ static const ActionData ACTION_DATA[Nb_Actions];
+ static const int KEYCODE_ONE[Nb_Actions];
+ static const int KEYCODE_TWO[Nb_Actions];
+
+ MPBoard *newBoard(uint);
+ void setInitData(uint player, ServerInitData &);
+ uint prev(uint i) const;
+ uint next(uint i) const;
+
+ void _readGameOverData(QDataStream &s);
+ void _sendGameOverData(QDataStream &s);
+ void _firstInit() {}
+ void _treatInit();
+ void _init();
+ void _showGameOverData();
+ bool _readPlayData();
+ void _sendPlayData();
+
+ void _start() { MPSimpleInterface::start(); }
+ void _pause() { MPSimpleInterface::pause(); }
+ bool _isPaused() const { return MPSimpleInterface::isPaused(); }
+};
+
+#endif