[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tads3] knowledge / 'seen' / npc knowledge base
- From: Jesse Welton <jwelton@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Subject: Re: [Tads3] knowledge / 'seen' / npc knowledge base
- Date: Fri, 12 Sep 2003 14:00:20 -0400 (EDT)
- To: tads3@xxxxxxxxxxx
steve breslin wrote:
>
> I think most vectors I have used could just as well have been sets; the same
> with lists. I could come up with new uses ideas, but I already have a bunch
> of examples of where I could have been using sets already. Just really
> simple stuff like keeping track of an object's contents -- that would be a
> good usage for a set, right? If I'm not off base here, and if sets would
> really be better than lists and vectors, it sounds like a good idea.
I can hardly believe I didn't even think of this completely pervasive
use of sets. This would definitely be an appropriate use for a Set,
although it would have some drawbacks. Less syntactical support, for
one (which could be addressed). But also, Sets are more optimized for
inclusion testing than iteration. And they're unordered. The
ordering of list elements isn't necessary for the containment model,
but it can be handy for the player to know that newly added contents
show up at the beginning (or end, as the case may be) of contents
lists, rather than randomly somewhere in the middle. There's also the
issue of the size of the contents lists, for which there are a variety
of trade-offs to consider.
Nevertheless, I think this clearly illustrates that modeling sets is
common and useful.
-Jesse