On Feb 17, 2008 5:48 PM, Thufir <hawat.thufir / gmail.com> wrote: > On Feb 16, 10:03 pm, "Christopher Dicely" <cmdic... / gmail.com> wrote: > > Since the main use is lookup by reference, and hash is designed for > > keyed access, hash would seem to be the natural container to use. I'm > > not sure I quite get what you are saying about iterating through a > > singleton instead, could you explain a little more? > [...] > > There's one set of rooms, which may have sub-sets, of course. But, > for the set of rooms you may want to iterate through each room for > whatever reason. Putting the rooms into a Singleton allows such > iteration in an inherently thread-safe way. I'm not sure I follow you. As far as I understand it, singletons refer to templates (the singleton classes) that allow instances of a class to have unique behavior if need be. It seems to me that instances of a Room would not need that. The only way I can currently imagine why one would need that is if the behavior of a single instance of a room changes during runtime. > Admittedly, I don't really understand Hash that well. It's just key/value pairs (where the key or the value can be any object). Todd