libkdegames/libkdegamesprivate/kgame
kgamepropertyhandler.cpp
Go to the documentation of this file.
56 KGamePropertyHandler::KGamePropertyHandler(int id, const QObject* receiver, const char * sendf, const char *emitf, QObject* parent)
85 void KGamePropertyHandler::registerHandler(int id,const QObject * receiver, const char * sendf, const char *emitf)
157 //kDebug(11001) << ": nid="<< (data->id()) << "inserted in Map name=" << d->mNameMap[data->id()];
QString propertyName(int id) const
Definition: kgamepropertyhandler.cpp:165
Definition: kgameproperty.h:66
void lockDirectEmit()
Called by the KGame or KPlayer object or the handler itself to delay emmiting of signals.
Definition: kgamepropertyhandler.cpp:276
void setId(int id)
Use id as new ID for this KGamePropertyHandler.
Definition: kgamepropertyhandler.cpp:80
bool isLocked() const
A locked property can only be changed by the player who has set the lock.
Definition: kgameproperty.h:190
A collection class for KGameProperty objects.
Definition: kgamepropertyhandler.h:73
void flush()
Sends all properties which are marked dirty over the network.
Definition: kgamepropertyhandler.cpp:262
bool hasNext() const
bool removeProperty(KGamePropertyBase *data)
Removes a property from the handler.
Definition: kgamepropertyhandler.cpp:134
const T & at(int i) const
void signalRequestValue(KGamePropertyBase *property, QString &value)
If you call propertyValue with a non-standard KGameProperty it is possible that the value cannot auto...
static void createPropertyHeader(QDataStream &msg, int id)
Creates a property header given the property id.
Definition: kgamemessage.cpp:72
static void extractPropertyCommand(QDataStream &msg, int &pid, int &cmd)
Retrieves the property id from a property message header.
Definition: kgamemessage.cpp:91
virtual bool load(QDataStream &stream)
Loads properties from the datastream.
Definition: kgamepropertyhandler.cpp:181
void registerHandler(int id, const QObject *receiver, const char *send, const char *emit)
Register the handler with a parent.
Definition: kgamepropertyhandler.cpp:85
int size() const
bool isNull() const
const char * name() const
QString number(int n, int base)
virtual bool save(QDataStream &stream)
Saves properties into the datastream.
Definition: kgamepropertyhandler.cpp:203
void emitSignal(KGamePropertyBase *data)
called by a property to emit a signal This call is simply forwarded to the parent object ...
Definition: kgamepropertyhandler.cpp:296
void lockProperties()
Calls KGamePropertyBase::setReadOnly(true) for all properties of this handler.
Definition: kgamepropertyhandler.cpp:248
int uniquePropertyId()
returns a unique property ID starting called usually with a base of KGamePropertyBase::IdAutomatic.
Definition: kgamepropertyhandler.cpp:257
void signalPropertyChanged(KGamePropertyBase *)
This is emitted by a property.
Definition: kgameproperty.h:65
void setPolicy(KGamePropertyBase::PropertyPolicy p, bool userspace=true)
Set the policy for all kgame variables which are currently registerd in the KGame proeprty handler...
Definition: kgamepropertyhandler.cpp:225
bool sendProperty(QDataStream &s)
called by a property to send itself into the datastream.
Definition: kgamepropertyhandler.cpp:315
void signalSendMessage(int msgid, QDataStream &, bool *sent)
This signal is emitted when a property needs to be sent.
QString propertyValue(KGamePropertyBase *property)
In several situations you just want to have a QString of a KGameProperty object.
Definition: kgamepropertyhandler.cpp:353
QMultiHash< int, KGamePropertyBase * > & dict() const
Reference to the internal dictionary.
Definition: kgamepropertyhandler.cpp:348
Item next()
KGamePropertyHandler(QObject *parent=0)
Construct an unregistered KGamePropertyHandler.
Definition: kgamepropertyhandler.cpp:62
virtual void load(QDataStream &s)=0
This will read the value of this property from the stream.
bool addProperty(KGamePropertyBase *data, const QString &name=QString())
Adds a KGameProperty property to the handler.
Definition: kgamepropertyhandler.cpp:144
Definition: kgameproperty.h:68
~KGamePropertyHandler()
Definition: kgamepropertyhandler.cpp:67
virtual void command(QDataStream &stream, int msgid, bool isSender=false)
send a command to advanced properties like arrays
Definition: kgameproperty.cpp:192
bool processMessage(QDataStream &stream, int id, bool isSender)
Main message process function.
Definition: kgamepropertyhandler.cpp:96
const T & value() const
static void extractPropertyHeader(QDataStream &msg, int &id)
Retrieves the property id from a property message header.
Definition: kgamemessage.cpp:77
void unlockProperties()
Calls KGamePropertyBase::setReadOnly(false) for all properties of this player.
Definition: kgamepropertyhandler.cpp:239
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
KGamePropertyBase::PropertyPolicy policy()
Returns the default policy for this property handler.
Definition: kgamepropertyhandler.cpp:220
void unlockDirectEmit()
Removes the lock from the emitting of property signals.
Definition: kgamepropertyhandler.cpp:281
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:54 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:54 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.