• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • libtdegames
 

libtdegames

  • libtdegames
  • kgame
kgamepropertyhandler.h
1/*
2 This file is part of the TDE games library
3 Copyright (C) 2001 Andreas Beckermann (b_mann@gmx.de)
4 Copyright (C) 2001 Martin Heni (martin@heni-online.de)
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License version 2 as published by the Free Software Foundation.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/
20
21#ifndef __KGAMEPROPERTYHANDLER_H_
22#define __KGAMEPROPERTYHANDLER_H_
23
24#include <tqobject.h>
25#include <tqintdict.h>
26
27#include "kgameproperty.h"
28#include <tdemacros.h>
29
30class TQDataStream;
31class KGame;
32class KPlayer;
33//class KGamePropertyBase;
34
35class KGamePropertyHandlerPrivate; // wow - what a name ;-)
36
72class TDE_EXPORT KGamePropertyHandler : public TQObject
73{
74 TQ_OBJECT
75
76
77public:
84 KGamePropertyHandler(TQObject* parent = 0);
85
91 KGamePropertyHandler(int id, const TQObject* receiver, const char* sendf, const char* emitf, TQObject* parent = 0);
92 ~KGamePropertyHandler();
93
105 void registerHandler(int id, const TQObject *receiver, const char * send, const char *emit);
106
122 bool processMessage(TQDataStream &stream, int id, bool isSender );
123
127 int id() const;
128
136 bool addProperty(KGamePropertyBase *data, TQString name=0);
137
143 bool removeProperty(KGamePropertyBase *data);
144
151 int uniquePropertyId();
152
153
160 virtual bool load(TQDataStream &stream);
161
168 virtual bool save(TQDataStream &stream);
169
175 bool sendProperty(TQDataStream &s);
176
177 void sendLocked(bool l);
178
184 void emitSignal(KGamePropertyBase *data);
185
192 TQString propertyName(int id) const;
193
198 KGamePropertyBase *find(int id);
199
213 void clear();
214
219 void setId(int id);//AB: TODO: make this protected in KGamePropertyHandler!!
220
225 void unlockProperties();
226
235 void setPolicy(KGamePropertyBase::PropertyPolicy p, bool userspace=true);
236
247 void lockDirectEmit();
248
253 void unlockDirectEmit();
254
259 KGamePropertyBase::PropertyPolicy policy();
260
270 void lockProperties();
271
276 void flush();
277
281 TQIntDict<KGamePropertyBase> &dict() const;
282
295 TQString propertyValue(KGamePropertyBase* property);
296
297
301 void Debug();
302
303
304signals:
315 void signalPropertyChanged(KGamePropertyBase *);
316
324 void signalSendMessage(int msgid, TQDataStream &, bool* sent); // AB shall we change bool* into bool& again?
325
345 void signalRequestValue(KGamePropertyBase* property, TQString& value);
346
347private:
348 void init();
349
350private:
351 KGamePropertyHandlerPrivate* d;
352};
353
354#endif
KGamePropertyBase
Base class of KGameProperty.
Definition: kgameproperty.h:43
KGamePropertyBase::PropertyPolicy
PropertyPolicy
The policy of the property.
Definition: kgameproperty.h:110
KGamePropertyHandler
A collection class for KGameProperty objects.
Definition: kgamepropertyhandler.h:73
KGamePropertyHandler::signalSendMessage
void signalSendMessage(int msgid, TQDataStream &, bool *sent)
This signal is emitted when a property needs to be sent.
KGamePropertyHandler::signalRequestValue
void signalRequestValue(KGamePropertyBase *property, TQString &value)
If you call propertyValue with a non-standard KGameProperty it is possible that the value cannot auto...
KGamePropertyHandler::signalPropertyChanged
void signalPropertyChanged(KGamePropertyBase *)
This is emitted by a property.
KGame
The main KDE game object.
Definition: kgame.h:63
KPlayer
Base class for a game player.
Definition: kplayer.h:70

libtdegames

Skip menu "libtdegames"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

libtdegames

Skip menu "libtdegames"
  • libtdegames
Generated for libtdegames by doxygen 1.9.4
This website is maintained by Timothy Pearson.