KDEGames
kplayer.cpp
69 d->mProperties.registerHandler(KGameMessage::IdPlayerProperty, this, SLOT(sendProperty(int, QDataStream &, bool *)), SLOT(emitSignal(KGamePropertyBase *)));
338 for (KGame::KGamePlayerList::iterator it = game()->playerList()->begin(); it != game()->playerList()->end(); ++it) {
389 // qCDebug(KDEGAMESPRIVATE_KGAME_LOG) ": msgid=" << msgid << "sender=" << sender << "we are=" << id();
407 Q_EMIT signalNetworkData(msgid - KGameMessage::IdUser, ((QBuffer *)stream.device())->readAll(), sender, this);
virtual void initIO(KPlayer *p)
Init this device by setting the player and e.g.
Definition kgameio.cpp:77
bool sendSystemMessage(const QByteArray &buffer, int msgid, quint32 receiver=0, quint32 sender=0)
Sends a network message msg with a given msg id msgid to all clients.
Definition kgamenetwork.cpp:390
A collection class for KGameProperty objects.
Definition kgamepropertyhandler.h:64
virtual bool sendPlayerInput(QDataStream &msg, KPlayer *player, quint32 sender=0)
Called by KPlayer to send a player input to the KMessageServer.
Definition kgame.cpp:652
bool sendPlayerProperty(int msgid, QDataStream &s, quint32 playerId)
This is called by KPlayer::sendProperty only! Internal function!
Definition kgame.cpp:1245
void playerDeleted(KPlayer *player)
Called by the destructor of KPlayer to remove itself from the game.
Definition kgame.cpp:435
virtual bool systemPlayerInput(QDataStream &msg, KPlayer *player, quint32 sender=0)
Called when a player input arrives from KMessageServer.
Definition kgame.cpp:668
void sendProperty(int msgid, QDataStream &stream, bool *sent)
Called by KGameProperty only! Internal function!
Definition kplayer.cpp:424
KGameIO * findRttiIO(int rtti) const
Finds the KGameIO devies with the given rtti code.
Definition kplayer.cpp:307
KGamePropertyBase * findProperty(int id) const
Searches for a property of the player given its id.
Definition kplayer.cpp:414
void signalPropertyChanged(KGamePropertyBase *property, KPlayer *me)
This signal is emitted if a player property changes its value and the property is set to notify this ...
void setAsyncInput(bool a)
Set whether this player can make turns/input all the time (true) or only when it is its turn (false) ...
Definition kplayer.cpp:125
bool hasRtti(int rtti) const
Checks whether this player has a IO device of the given rtti type.
Definition kplayer.cpp:302
bool removeGameIO(KGameIO *input=nullptr, bool deleteit=true)
remove (and delete) a game IO device
Definition kplayer.cpp:278
void networkTransmission(QDataStream &stream, int msgid, quint32 sender)
Receives a message.
Definition kplayer.cpp:387
virtual bool save(QDataStream &stream)
Save a player to a file OR to network.
Definition kplayer.cpp:375
KPlayer * networkPlayer() const
Returns the player which got inactivated to allow this player to be set up via network.
Definition kplayer.cpp:252
virtual bool forwardInput(QDataStream &msg, bool transmit=true, quint32 sender=0)
Forwards input to the game object..internal use only.
Definition kplayer.cpp:173
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.cpp:145
void emitSignal(KGamePropertyBase *me)
Called by KGameProperty only! Internal function!
Definition kplayer.cpp:434
virtual bool forwardMessage(QDataStream &msg, int msgid, quint32 receiver=0, quint32 sender=0)
Forwards Message to the game object..internal use only.
Definition kplayer.cpp:160
bool setTurn(bool b, bool exclusive=true)
Sets whether this player is the next to turn.
Definition kplayer.cpp:329
virtual bool load(QDataStream &stream)
Load a saved player, from file OR network.
Definition kplayer.cpp:352
void setNetworkPriority(int b)
Set whether this player can be replaced by a network player.
Definition kplayer.cpp:262
virtual const QString & group() const
Query the group the player belongs to.
Definition kplayer.cpp:212
void signalNetworkData(int msgid, const QByteArray &buffer, quint32 sender, KPlayer *me)
The player object got a message which was targeted at it but has no default method to process it.
int networkPriority() const
Returns whether this player can be replaced by a network connection player.
Definition kplayer.cpp:257
QString i18n(const char *text, const TYPE &arg...)
QIODevice * device() const const
iterator end()
bool hasNext() const const
const T & next()
Q_EMITQ_EMIT
QObject * sender() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:59:04 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:59:04 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.