kgameio.cpp
42 kdDebug(11001) << k_funcinfo << ": this=" << this << ", sizeof(this)" << sizeof(KGameIO) << endl;
48 kdDebug(11001) << k_funcinfo << ": this=" << this << ", sizeof(this)" << sizeof(KGameIO) << endl;
255 kdDebug(11001) << k_funcinfo << ": this=" << this << ", sizeof(this)=" << sizeof(KGameProcessIO) << endl;
271 //connect(d->mMessageClient, TQT_SIGNAL(forwardReceived(const TQByteArray&, TQ_UINT32, const TQValueList <TQ_UINT32> &)),
272 // this, TQT_SLOT(clientMessage(const TQByteArray&, TQ_UINT32, const TQValueList <TQ_UINT32> &)));
341 void KGameProcessIO::sendSystemMessage(TQDataStream &stream,int msgid, TQ_UINT32 receiver, TQ_UINT32 sender)
346 void KGameProcessIO::sendMessage(TQDataStream &stream,int msgid, TQ_UINT32 receiver, TQ_UINT32 sender)
351 void KGameProcessIO::sendAllMessages(TQDataStream &stream,int msgid, TQ_UINT32 receiver, TQ_UINT32 sender, bool usermsg)
353 kdDebug(11001) << "==============> KGameProcessIO::sendMessage (usermsg="<<usermsg<<")" << endl;
362 kdDebug(11001) << "=============* ProcessIO (" << msgid << "," << receiver << "," << sender << ") ===========" << endl;
372 kdDebug(11001) << " Adding user data from pos="<< device->at() <<" amount= " << data.size() << " byte " << endl;
380 //void KGameProcessIO::clientMessage(const TQByteArray& receiveBuffer, TQ_UINT32 clientID, const TQValueList <TQ_UINT32> &recv)
KGameProcessIO(const TQString &name)
Creates a computer player via a separate process.
Definition: kgameio.cpp:252
bool sendInput(TQDataStream &stream, bool transmit=true, TQ_UINT32 sender=0)
Send an input message using KPlayer::forwardInput.
Definition: kgameio.cpp:100
bool eventFilter(TQObject *o, TQEvent *e)
Internal method to process the events.
Definition: kgameio.cpp:140
virtual void notifyTurn(bool b)
Notifies the IO device that the player's setTurn had been called Called by KPlayer.
Definition: kgameio.cpp:71
void sendAllMessages(TQDataStream &stream, int msgid, TQ_UINT32 receiver, TQ_UINT32 sender, bool usermsg)
Internal ~ombined function for all message handling.
Definition: kgameio.cpp:351
void signalPrepareTurn(TQDataStream &stream, bool turn, KGameIO *io, bool *send)
Signal generated when KPlayer::myTurn changes.
virtual bool forwardInput(TQDataStream &msg, bool transmit=true, TQ_UINT32 sender=0)
Forwards input to the game object..internal use only.
Definition: kplayer.cpp:142
void setAdvancePeriod(int ms)
Start a TQTimer which calls advance every ms milli seconds.
Definition: kgameio.cpp:488
void receivedMessage(const TQByteArray &receiveBuffer)
Internal message handler to receive data from the process.
Definition: kgameio.cpp:381
void sendMessage(TQDataStream &stream, int msgid, TQ_UINT32 receiver, TQ_UINT32 sender)
Send a message to the process.
Definition: kgameio.cpp:346
void signalReaction()
This signal is emitted when your computer player is meant to do something, or better is meant to be a...
int userId() const
Returns the user defined id of the player This value can be used arbitrary by you to have some user i...
Definition: kplayer.h:208
void signalProcessQuery(TQDataStream &stream, KGameProcessIO *me)
A computer query message is received.
void signalKeyEvent(KGameIO *io, TQDataStream &stream, TQKeyEvent *m, bool *eatevent)
Signal handler for keyboard events.
KPlayer * player() const
This function returns the player who owns this IO.
Definition: kgameio.h:90
virtual void initIO(KPlayer *p)
Init this device by setting the player and e.g.
Definition: kgameio.cpp:66
void signalMouseEvent(KGameIO *io, TQDataStream &stream, TQMouseEvent *m, bool *eatevent)
Signal handler for mouse events.
void setMouseTracking(bool b)
Manually activate or deactivate mouse tracking.
Definition: kgameio.cpp:194
virtual bool forwardMessage(TQDataStream &msg, int msgid, TQ_UINT32 receiver=0, TQ_UINT32 sender=0)
Forwards Message to the game object..internal use only.
Definition: kplayer.cpp:128
virtual void notifyTurn(bool turn)
Notifies the IO device that the player's setTurn had been called Called by KPlayer.
Definition: kgameio.cpp:321
void sendSystemMessage(TQDataStream &stream, int msgid, TQ_UINT32 receiver, TQ_UINT32 sender)
Send a system message to the process.
Definition: kgameio.cpp:341
bool removeGameIO(KGameIO *input=0, bool deleteit=true)
remove (and delete) a game IO device
Definition: kplayer.cpp:231
virtual void reaction()
Default implementation simply emits signalReaction.
Definition: kgameio.cpp:534
void setReactionPeriod(int advanceCalls)
The number of advance calls until the player (or rather: the IO) does something (default: 1)...
Definition: kgameio.cpp:478
void signalIOAdded(KGameIO *game, TQDataStream &stream, KPlayer *p, bool *send)
Signal generated when the computer player is added.
KGameMouseIO(TQWidget *parent, bool trackmouse=false)
Creates a mouse IO device.
Definition: kgameio.cpp:170