Yet another entity/component system
Members - Reputation: 154
Posted 20 May 2011 - 04:18 AM
There are Components such as PhysicsComponent and RenderComponent which derive from Component. Each Entity contains a list of components (I don't see myself needing to query for a PhysicsComponent; I could just send it a message). Each Component may register to some system - e.g. the PhysicsSystem, or the graphicsSystem (I think these would be static; comment?)
The World derives from DrawableGameComponent, and calls Update on each entity (which calls it on each Component) and Render on the GraphicsSystem (which has the list of RenderComponents).
I don't see myself needing a hugely complex one.
Feedback on it?
Members - Reputation: 101
Posted 22 May 2011 - 10:41 AM
Each Component may register to some system - e.g. the PhysicsSystem, or the graphicsSystem (I think these would be static; comment?)
You might find this useful: http://gameprogrammingpatterns.com/service-locator.html
That way the systems wont have to be static, you can just have one static class that locates them.
There's also some stuff about components on that site.