libkdegames/kgame
kgameprocess.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 __KGAMEPROCESS_H_
00022 #define __KGAMEPROCESS_H_
00023
00024 #include <QtCore/QObject>
00025
00026 #include "kgameproperty.h"
00027 #include <libkdegames_export.h>
00028
00029 class KRandomSequence;
00030
00031 class KPlayer;
00032 class KMessageFilePipe;
00033 class KGameProcessPrivate;
00034
00043 class KDEGAMES_EXPORT KGameProcess: public QObject
00044 {
00045 Q_OBJECT
00046
00047 public:
00074 KGameProcess();
00078 ~KGameProcess();
00079
00084 bool exec(int argc, char *argv[]);
00085
00092 bool terminate() const {return mTerminate;}
00093
00100 void setTerminate(bool b) {mTerminate=b;}
00101
00111 void sendMessage(QDataStream &stream,int msgid,quint32 receiver=0);
00112
00132 void sendSystemMessage(QDataStream &stream,int msgid,quint32 receiver=0);
00133
00143 KRandomSequence *random();
00144
00145 protected:
00150 void processArgs(int argc, char *argv[]);
00151
00152 protected Q_SLOTS:
00157 void receivedMessage(const QByteArray& receiveBuffer);
00158
00159 Q_SIGNALS:
00181 void signalCommand(QDataStream &inputStream,int msgid,int receiver,int sender);
00182
00220 void signalTurn(QDataStream &stream,bool turn);
00221
00233 void signalInit(QDataStream &stream,int userid);
00234
00235 protected:
00236 bool mTerminate;
00237 KMessageFilePipe *mMessageIO;
00238 private:
00239 friend class KGameProcessPrivate;
00240 KGameProcessPrivate *const d;
00241
00242 Q_DISABLE_COPY(KGameProcess)
00243 };
00244 #endif