Re: Entity Communication & Use of Reflection
2010-01-07 21:57:45 GMT
1) Components have a container. A pointer to this is basically your entity id. Components have an initialise(ComponentContainer&) method. Here they can cache pointers to other components they require. Runtime dynamic lookup is baad. This implies some dependency order in initialisation. Static downcast using type system gets you from IComponent to the type your require.
David (Black), could you please elaborate how you handle communications between different components? More specifically, how do you handle these:
1) How do two (different) components, both of which belong to the same entity, communicate?
2) How do two identical components, each of which belongs to a different entity, communicate?
3) How do two different components, each of which belongs to a different entity, communicate?
I suppose the most general way is to have a universal message dispatcher. This way, message handling can also be done in separate threads.
Besides, could you also describe how reflection can be put to good use in a component-based entity system?
Thanks!On Thu, Dec 17, 2009 at 10:38 PM, <sweng-gamedev-request <at> lists.midnightryder.com> wrote:sweng-gamedev <at> midnightryder.com
--
Mike Ditka - "If God had wanted man to play soccer, he wouldn't have given us arms."
_______________________________________________
Sweng-Gamedev mailing list
Sweng-Gamedev <at> lists.midnightryder.com
http://lists.midnightryder.com/listinfo.cgi/sweng-gamedev-midnightryder.com
_______________________________________________ Sweng-Gamedev mailing list Sweng-Gamedev <at> lists.midnightryder.com http://lists.midnightryder.com/listinfo.cgi/sweng-gamedev-midnightryder.com
RSS Feed