Creating Entity as an aggregation
- by Jamie Dixon
I recently asked about how to separate entities from their behaviour and the main answer linked to this article: http://cowboyprogramming.com/2007/01/05/evolve-your-heirachy/
The ultimate concept written about here is that of: OBJECT AS A PURE AGGREGATION.
I'm wondering how I might go about creating game entities as pure aggregation using C#. I've not quite grasped the concept of how this might work yet. (Perhaps the entity is an array of objects implementing a certain interface or base type?)
My current thinking still involves having a concrete class for each entity type that then implements the relevant interfaces (IMoveable, ICollectable, ISpeakable etc).
How can I go about creating an entity purely as an aggregation without having any concrete type for that entity?