KDEGames
kgameproperty.cpp
61 mFlags.bits.locked = false; // setLocked(false); is NOT possible as it checks whether isLocked() allows to change the status
77int KGamePropertyBase::registerData(KGamePropertyHandler *owner, PropertyPolicy p, const QString &name)
87int KGamePropertyBase::registerData(int id, KGamePropertyHandler *owner, PropertyPolicy p, const QString &name)
187 qCCritical(KDEGAMESPRIVATE_KGAME_LOG) << ":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
static void createPropertyCommand(QDataStream &msg, int cmdid, int pid, int cmd)
Creates a property header given the property id.
Definition kgamemessage.cpp:74
KGamePropertyBase()
Creates a KGamePropertyBase object without an owner.
Definition kgameproperty.cpp:38
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:173
void setEmittingSignal(bool p)
Sets this property to emit a signal on value changed.
Definition kgameproperty.h:155
void setLock(bool l)
A locked property can only be changed by the player who has set the lock.
Definition kgameproperty.cpp:166
void setPolicy(PropertyPolicy p)
Changes the consistency policy of a property.
Definition kgameproperty.h:137
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:87
bool sendProperty()
Forward the data to the owner of this property which then sends it over network.
Definition kgameproperty.cpp:120
bool lock()
A locked property can only be changed by the player who has set the lock.
Definition kgameproperty.cpp:148
bool unlock(bool force=false)
A locked property can only be changed by the player who has set the lock.
Definition kgameproperty.cpp:157
void emitSignal()
Causes the parent object to emit a signal on value change.
Definition kgameproperty.cpp:181
virtual void command(QDataStream &stream, int msgid, bool isSender=false)
send a command to advanced properties like arrays
Definition kgameproperty.cpp:191
bool isLocked() const
A locked property can only be changed by the player who has set the lock.
Definition kgameproperty.h:200
A collection class for KGameProperty objects.
Definition kgamepropertyhandler.h:64
bool sendProperty(QDataStream &s)
called by a property to send itself into the datastream.
Definition kgamepropertyhandler.cpp:300
int uniquePropertyId()
returns a unique property ID starting called usually with a base of KGamePropertyBase::IdAutomatic.
Definition kgamepropertyhandler.cpp:247
bool removeProperty(KGamePropertyBase *data)
Removes a property from the handler.
Definition kgamepropertyhandler.cpp:124
bool addProperty(KGamePropertyBase *data, const QString &name=QString())
Adds a KGameProperty property to the handler.
Definition kgamepropertyhandler.cpp:134
void emitSignal(KGamePropertyBase *data)
called by a property to emit a signal This call is simply forwarded to the parent object
Definition kgamepropertyhandler.cpp:284
KGamePropertyBase::PropertyPolicy policy()
Returns the default policy for this property handler.
Definition kgamepropertyhandler.cpp:210
KGamePropertyHandler * dataHandler() const
Returns a pointer to the KGame property handler.
Definition kgame.cpp:627
char * data()
qsizetype size() const const
int writeRawData(const char *s, int len)
WriteOnly
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:13:43 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:13:43 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.