blob: 9feed6017dddd2202a072fb1fc3928c76e117fd2 [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001// MorgenGrauen MUDlib
2//
3// thing/properties.h -- contains property definitions and prototypes
4//
5// $Id: properties.h,v 3.5 2003/08/07 15:09:33 Rikus Exp $
6
7#ifndef __THING_PROPERTIES_H__
8#define __THING_PROPERTIES_H__
9
Zesstra375df1e2021-04-21 11:09:06 +020010// Flags indexing <prop> and they are used as well for Set() calls
MG Mud User88f12472016-06-24 23:31:02 +020011#define F_VALUE 0
12#define F_MODE 1
13#define F_SET_METHOD 2
14#define F_QUERY_METHOD 3
Zesstra375df1e2021-04-21 11:09:06 +020015
16// Flags for Set() to modify/manipulate F_MODE of a property in bit-wise
17// manner
MG Mud User88f12472016-06-24 23:31:02 +020018#define F_MODE_AS 4
19#define F_MODE_AD 5
20
Zesstra375df1e2021-04-21 11:09:06 +020021// mode flags for Properties
MG Mud User88f12472016-06-24 23:31:02 +020022#define SAVE 64
23#define PROTECTED 128 // only this_object() can change the values
24#define SECURED 256 // like PROTECTED, but never resetable
25#define NOSETMETHOD 512 // Keine Set-Methode => Nicht mofifizierbar
Zesstra375df1e2021-04-21 11:09:06 +020026// Problem with the following: shadows, default methods etc. may change the
27// result at runtime and they do not save that much time (or even at all?)
28// because of the apply cache of the driver. Not used since 1995. But
29// be careful about re-using the values because of ancient (!) savefiles
30#define SETMNOTFOUND 1024 // Keine Set-Methode gefunden. Not used.
31#define QUERYMNOTFOUND 2048 // Keine Query-Methode gefunden. Not used.
32#define QUERYCACHED 4096 // Not used anymore
33#define SETCACHED 8192 // Not used anymore
MG Mud User88f12472016-06-24 23:31:02 +020034
35#endif // __THING_PROPERTIES_H__
36
37#ifdef NEED_PROTOTYPES
38
39#ifndef __THING_PROPERTIES_H_PROTO__
40#define __THING_PROPERTIES_H_PROTO__
41
42// prototypes
43
MG Mud User88f12472016-06-24 23:31:02 +020044// direct property access
45public varargs mixed Set(string name, mixed Value, int Type, int extern);
46public varargs mixed Query(string name, int Type);
47
48// filtered property access
49public mixed SetProp(string name, mixed Value);
50public mixed QueryProp(string name);
51
52// global property handling
53public void SetProperties(mapping props);
54public mapping QueryProperties();
55
56// misc/interna
57public mixed *__query_properties();
58public void _set_save_data(mixed data);
59public mixed _get_save_data();
60
61#endif // __THING_PROPERTIES_H_PROTO__
62
63#endif // NEED_PROTOTYPES