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
virtual bool load(QDataStream &stream)
Load a saved player, from file OR network.
Definition: kplayer.cpp:352
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.
Q_EMITQ_EMIT
bool asyncInput() const
Query whether this player does asynchronous input.
Definition: kplayer.cpp:130
void networkTransmission(QDataStream &stream, int msgid, quint32 sender)
Receives a message.
Definition: kplayer.cpp:387
int networkPriority() const
Returns whether this player can be replaced by a network connection player.
Definition: kplayer.cpp:257
bool setTurn(bool b, bool exclusive=true)
Sets whether this player is the next to turn.
Definition: kplayer.cpp:329
bool hasNext() const const
QIODevice * device() const const
QObject * sender() const const
void emitSignal(KGamePropertyBase *me)
Called by KGameProperty only! Internal function!
Definition: kplayer.cpp:434
bool hasRtti(int rtti) const
Checks whether this player has a IO device of the given rtti type.
Definition: kplayer.cpp:302
virtual const QString & group() const
Query the group the player belongs to.
Definition: kplayer.cpp:212
const T & next()
bool sendPlayerProperty(int msgid, QDataStream &s, quint32 playerId)
This is called by KPlayer::sendProperty only! Internal function!
Definition: kgame.cpp:1245
virtual bool save(QDataStream &stream)
Save a player to a file OR to network.
Definition: kplayer.cpp:375
QString i18n(const char *text, const TYPE &arg...)
void setNetworkPriority(int b)
Set whether this player can be replaced by a network player.
Definition: kplayer.cpp:262
A collection class for KGameProperty objects.
Definition: kgamepropertyhandler.h:63
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
KGamePropertyBase * findProperty(int id) const
Searches for a property of the player given its id.
Definition: kplayer.cpp:414
void sendProperty(int msgid, QDataStream &stream, bool *sent)
Called by KGameProperty only! Internal function!
Definition: kplayer.cpp:424
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 ...
bool removeGameIO(KGameIO *input=nullptr, bool deleteit=true)
remove (and delete) a game IO device
Definition: kplayer.cpp:278
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
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
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
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
KGameIO * findRttiIO(int rtti) const
Finds the KGameIO devies with the given rtti code.
Definition: kplayer.cpp:307
virtual bool forwardInput(QDataStream &msg, bool transmit=true, quint32 sender=0)
Forwards input to the game object..internal use only.
Definition: kplayer.cpp:173
void playerDeleted(KPlayer *player)
Called by the destructor of KPlayer to remove itself from the game.
Definition: kgame.cpp:435
QList::iterator end()
virtual bool systemPlayerInput(QDataStream &msg, KPlayer *player, quint32 sender=0)
Called when a player input arrives from KMessageServer.
Definition: kgame.cpp:668
KPlayer * networkPlayer() const
Returns the player which got inactivated to allow this player to be set up via network.
Definition: kplayer.cpp:252
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Nov 30 2023 04:08:07 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Nov 30 2023 04:08:07 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.