blob: 667078a78214f39bb2b1c6253c29b2a381c6d895 [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001OBJECT:
2 container
3
4
5DESCRIPTION:
6 A cointainer is a special object which can contain other objects.
7 It provides the same functions as the thing(S) class, but adds
8 some functions for the handling of contents. It defines some
9 properties related to what and how much is contained in it.
10
11 The following additional properties are defined for a container:
12 P_MAX_WEIGHT, P_WEIGHT_CONTENTS
13
14 Note that the weight of a container is handled especially:
15 SetProp(P_WEIGHT,weight) sets the weight of the container
16 without contents, while QueryProp(P_WEIGHT) returns the total
17 weight of the container plus contents.
18
19 For now, you may use the following function to add or remove
20 weight from the container.
21
22 AddWeight(weight)
23 Adds <weight> to the container. If its OK, 1 is returned,
24 otherwise 0. Only if the weight fits into the container, the
25 weight is adjusted.
26
27 MayAddWeight(weight)
28 Like AddWeight, but if the weight fits inside the container,
29 the total weight is NOT updated. You may use this function to
30 test if an object fits into a container.
31
32 NOTE: Currently, these functions may be called from outside.
33 In a alter stage, movement of objects will be done by calling
34 the move() function in the object to be moved. The move()
35 function of that object will then call (May)AddWeight() itself
36 to determine if it may enter the container.
37
38
39INHERITANCE TREE:
40 container
41 |-thing/moving
42 |-thing/properties
43 |-container/description
44 | `-thing/description
45 `-container/restrictions
46
47
48SEE ALSO:
49 thing(S)