MOO-cows Mailing List Archive
[Prev][Next][Index][Thread]
Re: Changing parents & dynamic properties
PILOSOF AVI <avi.pilosof@tafensw.edu.au> wrote:
>I had created 10 rooms, all of which descended from the standard room.
>
>I then used one of them to test the conferencing system by adding
>properties, verbs, etc.
>
>Now I wanted all these rooms to behave in the same way, so I @chparent'ed
>all of them to have the test room as their parent.
>
>However, now when I use some of the property-changing verbs on the test
>room, the properties change on ALL the rooms. I thought that a child object
>was a whole new copy of the object, and had separate (altho identical)
>properties.
@chparent'ing the rooms to the test room has a similar affect as if you had
just created a new child of the test room. It now has all the verbs and
properties of the test room. It's properties are at this point `inherited'
from
the parent (similar to verbs). Thus changing the property on the parent
changes it on the child. *IF* you @set the properties of the child, they
will then be stored locally on the child object, and will no longer reference
the parent at all (even if you @set them to the same value). So until a
property is altered locally, it is just inherited from the parent. Once there
is an alteration that inheritance is broken forever.
-Dee
<><
References:
Home |
Subject Index |
Thread Index