From: Josh <axl...@gm...> - 2009-07-04 12:10:37
|
Not all nodes need to have a name. I don't like having to pass a string into object constructors, like we did in HG1. Should this register be used only for things that want to be found by other objects? What is the intention here? Direct interaction between nodes should be minimized to help us thread updates in the future. Josh Charles Lohr wrote: > Devs, > > I'm looking into adding a way for nodes to be indexable globally and > locally. > > In HG1, we were able to say OBJECTREGISTER.GetObjectByName( > "MyCameraControl" ); And it would return a pointer to the object > "MyCameraControl." Also, we were able to, if need be, get a list of all > of the objects. > > In HG2, I feel like it would be useful to be able to have the same > functionality there. Maybe, all objects could be indexed by name. > > Also, HG2 could have an additional feature (This is actually what I want > first): Another function, to say GetChildByName( "NameOfObject" ); That > could search a current node's children and its children's children for > that node. This function could/should be asymptotically slower than the > overall object register. > > This would leave us to implement two things: > > 1) OBJECTREGISTER (using an std::map<> or an MHash) > 2) GetChildByName function added to MercuryNode. > > I could implement both. > > My only concern with #1 is it does add to the overhead of objects if > they have to register with some central command, so-to-speak. We could > avoid this by making it so only named objects register with > OBJECTREGISTER. This does remove the feature of being able to get a > list of all objects, but I am not really sure what the right tradeoff > here is... > > Charles Lohr > > ------------------------------------------------------------------------------ > _______________________________________________ > Hgengine-devs mailing list > Hge...@li... > https://lists.sourceforge.net/lists/listinfo/hgengine-devs > |