shadow |
Discworld efun help |
shadow |
object shadow(object ob, int flag)
If flag is 1, then current object will shadow ob. If flag is 0, then either 0 will be returned, or the object that is shadow for ob.
An object that defines the funtion query_prevent_shadow() to return 1 can't be shadowed, and the shadow() function will return 0 instead of ob.
If an object a shadows an object b, then all call_other() to b will be redirected to a. If object a has not defined the function, then the call will be passed on to b. There is only one object that can call functions in b with call_other(), and that is a. Not even object b can call_other() itself. All normal (internal) function calls inside b will however remain internal to b.
There are two ways to remove the shadow. Either destruct it, or the object that was shadowed. In the latter case, the shadow will also be destructed automatically.
The result is that it is possible to hide an object behind another one, but everything can be totally transparent.