[Reality] Re: darkness

James Knight jknight@MIT.EDU
Sun, 22 Aug 1999 19:44:58 -0400


At 6:27 PM -0400 8/22/99, Glyph Lefkowitz wrote:
>Aah, this would be a very bad idea.  If this were the case, setFocus()
>would have to call Look. (And then what would Look call?)
>
>I would recommend you have a look at the source-code there...
>
>Also, darkness has effects other than description.  It makes a room's
>contents inoperable and invisible.
>
>Perhaps we should have an isOperableTo() and isVisibleTo() properties...
>then we could handle darkness with a few dynamic properties.  The method
>you've described, however, is not viable.

Nononono...those should really be properties...not special things like they
are now. Then the 'to' versions already exist, and everything is all happy.
Also they will inherit, and do all those nice things properties do.
However, there is one real bug with dynamic properties combined with
Property Change Listeners (which don't exist yet, but we should add)...that
is that there's no real good way to tell if a dynamicproperty has changed.
This is basically a concrete limitation, in that there is no way to work
around it in a general way. However, for specific instances, it is workable.

Lets take for example the mirror in the Divunal demo area. That has a
dynamicproperty for its description that takes the description of the
Player looking at it, and uses that in its string. Now, the mirror should
really change when you change your description. To do this, it needs to be
registered as a Property Change Listener on the Player's description, and
if that changes, trigger a property change event on _it's_ description [to
that player].

The same kinda thing might be workable for dark rooms too, although it is a
significantly more complex example, and I haven't fully thought it out yet.
However, given that darkness is a fairly general thing, and in fact, ALL
rooms should be "Class_Dark Room" really (with the darkness set to light),
it might be better to rethink doing it as dynamicproperties for description
and stuff.
-James

--
You are in a maze of testy little Java VMs, all subtly different.