blob: be7a6cdd9497deabfc83ce82c5c7ea3c7c01903c [file] [log] [blame]
// MorgenGrauen MUDlib
//
// thing/properties.h -- contains property definitions and prototypes
//
// $Id: properties.h,v 3.5 2003/08/07 15:09:33 Rikus Exp $
#ifndef __THING_PROPERTIES_H__
#define __THING_PROPERTIES_H__
// Flags indexing <prop> and they are used as well for Set() calls
#define F_VALUE 0
#define F_MODE 1
#define F_SET_METHOD 2
#define F_QUERY_METHOD 3
// The following are used as type flags for Set(), but they do not index
// <prop>, therfore they have a negative sign.
//
// F_SET_MAPPER sets F_SET_METHOD, but additionally sets the mode SETMAPPED
// automatically
#define F_SET_MAPPER -F_SET_METHOD
// Flags for Set() to modify/manipulate F_MODE of a property in bit-wise
// manner
#define F_MODE_AS 4
#define F_MODE_AD 5
// mode flags for Properties
#define SAVE 64
#define PROTECTED 128 // only this_object() can change the values
#define SECURED 256 // like PROTECTED, but never resetable
#define NOSETMETHOD 512 // Keine Set-Methode => Nicht mofifizierbar
#define SETMAPPED 0x4000 // Setmethod only maps, not sets
// Problem with the following: shadows, default methods etc. may change the
// result at runtime and they do not save that much time (or even at all?)
// because of the apply cache of the driver. Not used since 1995. But
// be careful about re-using the values because of ancient (!) savefiles
#define SETMNOTFOUND 1024 // Keine Set-Methode gefunden. Not used.
#define QUERYMNOTFOUND 2048 // Keine Query-Methode gefunden. Not used.
#define QUERYCACHED 4096 // Not used anymore
#define SETCACHED 8192 // Not used anymore
#endif // __THING_PROPERTIES_H__
#ifdef NEED_PROTOTYPES
#ifndef __THING_PROPERTIES_H_PROTO__
#define __THING_PROPERTIES_H_PROTO__
// prototypes
// direct property access
public mixed Set(string name, mixed Value,
int Type = F_VALUE, int drop_priv = extern_call());
public mixed Query(string name, int Type = F_VALUE);
// filtered property access
public mixed SetProp(string name, mixed Value, int drop_priv = extern_call());
public mixed QueryProp(string name);
public mixed AddToProp(string pname,
<int|float|string|mixed*|mapping|bytes> add_value);
public mixed SubFromProp(string pname,
<int|float|string|mixed*|mapping|bytes> sub_value);
// global property handling
public void SetProperties(mapping props);
public mapping QueryProperties();
// misc/interna
public mixed *__query_properties();
public void _set_save_data(mixed data);
public mixed _get_save_data();
#endif // __THING_PROPERTIES_H_PROTO__
#endif // NEED_PROTOTYPES