Creating Entity as an aggregation

Posted by Jamie Dixon on Game Development See other posts from Game Development or by Jamie Dixon
Published on 2011-02-02T05:54:53Z Indexed on 2011/02/02 7:33 UTC
Read the original article Hit count: 553

Filed under:
|
|
|

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?

© Game Development or respective owner

Related posts about c#

Related posts about design-patterns