blob: c472af5e8e15e4e1833afc6e71bfe9573089577c [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
Zesstra5c0c4092021-09-08 23:27:54 +020045public mixed Set(string name, mixed Value,
46 int Type = F_VALUE, int drop_priv = extern_call());
47public mixed Query(string name, int Type = F_VALUE);
MG Mud User88f12472016-06-24 23:31:02 +020048
49// filtered property access
Zesstraffcd0fe2021-09-08 23:33:17 +020050public mixed SetProp(string name, mixed Value, int drop_priv = extern_call());
MG Mud User88f12472016-06-24 23:31:02 +020051public mixed QueryProp(string name);
Zesstrafaebc152021-07-06 22:21:47 +020052public mixed AddToProp(string pname,
53 <int|float|string|mixed*|mapping|bytes> add_value);
54public mixed SubFromProp(string pname,
55 <int|float|string|mixed*|mapping|bytes> sub_value);
MG Mud User88f12472016-06-24 23:31:02 +020056
57// global property handling
58public void SetProperties(mapping props);
59public mapping QueryProperties();
60
61// misc/interna
62public mixed *__query_properties();
63public void _set_save_data(mixed data);
64public mixed _get_save_data();
65
66#endif // __THING_PROPERTIES_H_PROTO__
67
68#endif // NEED_PROTOTYPES