libkdegames/kggzmod
module_private.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KGGZMOD_MODULE_PRIVATE_H
00022 #define KGGZMOD_MODULE_PRIVATE_H
00023
00024 #include <kggzmod/module.h>
00025 #include <kggzmod/player.h>
00026
00027 #include <QtCore/QSocketNotifier>
00028 #include <QtCore/QList>
00029
00030 class KGGZRaw;
00031
00032 namespace KGGZMod
00033 {
00034
00035 class ModulePrivate : public QObject
00036 {
00037 Q_OBJECT
00038 public:
00039 enum GGZEvents
00040 {
00041 msglaunch = 0,
00042 msgserver = 1,
00043 msgserverfd = 2,
00044 msgplayer = 3,
00045 msgseat = 4,
00046 msgspectatorseat = 5,
00047 msgchat = 6,
00048 msgstats = 7,
00049 msginfo = 8,
00050 msgrankings = 9
00051 };
00052
00053 void connect();
00054 void disconnect();
00055 void sendRequest(Request request);
00056 void insertPlayer(Player::Type seattype, const QString &name, int seat);
00057 Player *findPlayer(Player::Type seattype, const QString &name);
00058 Player *self() const;
00059 QString opcodeString(GGZEvents opcode);
00060 QString requestString(Request::Type requestcode);
00061
00062 QString m_name;
00063 int m_fd;
00064 Module::State m_state;
00065 QList<Player*> m_players;
00066 QList<Player*> m_spectators;
00067
00068 QSocketNotifier *m_notifier;
00069 QSocketNotifier *m_gnotifier;
00070 KGGZRaw *m_net;
00071
00072 int m_playerseats;
00073 int m_spectatorseats;
00074
00075 int m_myseat;
00076 bool m_myspectator;
00077
00078 public slots:
00079 void slotGGZEvent();
00080
00081 signals:
00082 void signalEvent(const KGGZMod::Event& event);
00083 void signalError();
00084 void signalNetwork(int fd);
00085 };
00086
00087 }
00088
00089 #endif
00090