MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame^] | 1 | // MorgenGrauen MUDlib |
| 2 | // |
| 3 | // mini_props.c -- Abgespeckte Verwaltung von Props |
| 4 | // Aus Sicherheitsgruenden darf hier nicht die "Vollversion" |
| 5 | // mit echten Properties stehen |
| 6 | // |
| 7 | // $Id$ |
| 8 | #pragma strict_types,save_types |
| 9 | #pragma no_clone |
| 10 | #pragma no_shadow |
| 11 | #pragma pedantic,range_check,warn_deprecated |
| 12 | |
| 13 | #define NEED_PROTOTYPES |
| 14 | #include <thing/properties.h> |
| 15 | #undef NEED_PROTOTYPES |
| 16 | |
| 17 | nosave mapping prop; |
| 18 | |
| 19 | private void InitProps() |
| 20 | { |
| 21 | prop = m_allocate(2,1); |
| 22 | } |
| 23 | |
| 24 | |
| 25 | public varargs mixed Query( string str, int type ) |
| 26 | { |
| 27 | if ( !mappingp(prop) ) |
| 28 | InitProps(); |
| 29 | |
| 30 | return prop[str]; |
| 31 | } |
| 32 | |
| 33 | public varargs mixed Set(string name, mixed value, int type, int extern) |
| 34 | { |
| 35 | if ( !mappingp(prop) ) |
| 36 | InitProps(); |
| 37 | |
| 38 | return prop[name] = value; |
| 39 | } |
| 40 | |