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

Re: [Tads3] knowledge / 'seen' / npc knowledge base



> Agreed - that's the usage I had in mind.  I'll think about adding it, 
> although I'm not sure it would really be justified given the light use it 
> would probably see (even counting the space savings and improved 
> abstraction).  Any opinions on the value of adding this? - in particular, 
> does anyone think they'd have a lot of use for it?

I don't think it's worth adding an new metaclass just to save, what, 7 bytes per entry?

>   addElement(x)
>   removeElement(x)

However, if we decide to add one anyway, be sure to add a "setElement"
method  (or something), as in:

setKnownBy(actor, val)
{
    actor.knowledgeTable.setElement(self, val);
}

instead of forcing a

setKnownBy(actor, val)
{
    if (val) actor.knowledgeTable.addElement(self);
    else actor.knowledgeTable.removeElement(self);
}

Søren J. Løvborg
kwi@it.dk