[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tads3] UnderSurface - Second Thoughts



Søren J. Løvborg wrote:

> What about a more general HiddenItem class?
> (Also, the object will never be listed if it has no sight-presence,
right?)

Wrong: at least when I experimented with your proposed class just now it
listed the hidden item when it shouldn't have done, while adding isListed =
nil to the definition of HiddenItem (and isListed = true;) to the definition
of HiddenItem.discover() fixed it.

The idea of generalizing HiddenItem is a good one, but even with the
isListed code added it doesn't seem to work for a HiddenItem inside a
container (at least it doesn't work the way I envisaged it), for a simple
EXAMINE command gets a Container to announce its HiddenItem contents. To fix
that you also have to add isListedInContents = nil etc, so that the
HiddenItem class becomes:

class HiddenItem : object
  sightPresence = nil
  isListed = nil
  isListedInContents = nil
    discover()
    {
        sightPresence = true;
        isListed = true;
        isListedInContents = true;
    }
;

With that proviso I think your idea is a good one and might well be worth
implementing in the library.

-- Eric