[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tads3] knowledge / 'seen' / npc knowledge base
- From: "Søren J. Løvborg" <kwi@xxxxx>
- Subject: Re: [Tads3] knowledge / 'seen' / npc knowledge base
- Date: Fri, 12 Sep 2003 08:50:45 -0000
- To: <tads3@xxxxxxxxxxx>
> 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