KDEGames
kgameproperty.cpp
60 mFlags.bits.locked = false; // setLocked(false); is NOT possible as it checks whether isLocked() allows to change the status
76 int KGamePropertyBase::registerData(KGamePropertyHandler *owner, PropertyPolicy p, const QString &name)
86 int KGamePropertyBase::registerData(int id, KGamePropertyHandler *owner, PropertyPolicy p, const QString &name)
186 qCCritical(GAMES_PRIVATE_KGAME) << ":id=" << id() << " Cannot emitSignal because there is no handler set";
static void createPropertyHeader(QDataStream &msg, int id)
Creates a property header given the property id.
Definition: kgamemessage.cpp:62
WriteOnly
int registerData(int id, KGamePropertyHandler *owner, PropertyPolicy p, const QString &name=QString())
You have to register a KGamePropertyBase before you can use it.
Definition: kgameproperty.cpp:86
void emitSignal()
Causes the parent object to emit a signal on value change.
Definition: kgameproperty.cpp:180
void setLock(bool l)
A locked property can only be changed by the player who has set the lock.
Definition: kgameproperty.cpp:165
bool sendProperty()
Forward the data to the owner of this property which then sends it over network.
Definition: kgameproperty.cpp:119
void setOptimized(bool p)
Sets this property to try to optimize signal and network handling by not sending it out when the prop...
Definition: kgameproperty.h:168
static void createPropertyCommand(QDataStream &msg, int cmdid, int pid, int cmd)
Creates a property header given the property id.
Definition: kgamemessage.cpp:74
void emitSignal(KGamePropertyBase *data)
called by a property to emit a signal This call is simply forwarded to the parent object
Definition: kgamepropertyhandler.cpp:306
bool isLocked() const
A locked property can only be changed by the player who has set the lock.
Definition: kgameproperty.h:195
bool removeProperty(KGamePropertyBase *data)
Removes a property from the handler.
Definition: kgamepropertyhandler.cpp:126
bool unlock(bool force=false)
A locked property can only be changed by the player who has set the lock.
Definition: kgameproperty.cpp:156
bool addProperty(KGamePropertyBase *data, const QString &name=QString())
Adds a KGameProperty property to the handler.
Definition: kgamepropertyhandler.cpp:136
int writeRawData(const char *s, int len)
A collection class for KGameProperty objects.
Definition: kgamepropertyhandler.h:63
int uniquePropertyId()
returns a unique property ID starting called usually with a base of KGamePropertyBase::IdAutomatic.
Definition: kgamepropertyhandler.cpp:265
void setPolicy(PropertyPolicy p)
Changes the consistency policy of a property.
Definition: kgameproperty.h:132
bool sendProperty(QDataStream &s)
called by a property to send itself into the datastream.
Definition: kgamepropertyhandler.cpp:322
virtual void command(QDataStream &stream, int msgid, bool isSender=false)
send a command to advanced properties like arrays
Definition: kgameproperty.cpp:190
KGamePropertyBase::PropertyPolicy policy()
Returns the default policy for this property handler.
Definition: kgamepropertyhandler.cpp:216
KGamePropertyBase()
Creates a KGamePropertyBase object without an owner.
Definition: kgameproperty.cpp:37
KGamePropertyHandler * dataHandler() const
Returns a pointer to the KGame property handler.
Definition: kgame.cpp:666
bool lock()
A locked property can only be changed by the player who has set the lock.
Definition: kgameproperty.cpp:147
int size() const const
void setEmittingSignal(bool p)
Sets this property to emit a signal on value changed.
Definition: kgameproperty.h:150
char * data()
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon May 8 2023 03:49:44 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon May 8 2023 03:49:44 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.