A cointainer is a special object which can contain other objects.
It provides the same functions as the thing(S) class, but adds
some functions for the handling of contents. It defines some
properties related to what and how much is contained in it.
The following additional properties are defined for a container:
Note that the weight of a container is handled especially:
SetProp(P_WEIGHT,weight) sets the weight of the container
without contents, while QueryProp(P_WEIGHT) returns the total
weight of the container plus contents.
For now, you may use the following function to add or remove
weight from the container.
Adds to the container. If its OK, 1 is returned,
otherwise 0. Only if the weight fits into the container, the
weight is adjusted.
Like AddWeight, but if the weight fits inside the container,
the total weight is NOT updated. You may use this function to
test if an object fits into a container.
NOTE: Currently, these functions may be called from outside.
In a alter stage, movement of objects will be done by calling
the move() function in the object to be moved. The move()
function of that object will then call (May)AddWeight() itself
to determine if it may enter the container.
zurück zur Übersicht
letzte Aktualisierung: 2.2.2014
© MorgenGrauen. Alle Rechte vorbehalten.