I found this article
Smash TV 3D Design quite informative.
It pretty much describes what you want to achieve and also flattens deep inheritance hierarchies and replaces them with a containment / systems approach.
I guess it's up to you if you go the 1 class / 2 classes approach. I went with 2 - Actor and ActorData, with Actor having pointers to the data which is stored in a std::map.
I limited my inheritance to 3 levels...
e.g.
Actor::Alien::LanderActor::Alien::MutantActor::Bullet::MissileActor::Bullet::LaserActor::Ship::StandardActor::Ship::FastetcCDataStore < ActorClassEnum, ActorData >CDataStore < ActorClassEnum, AlienData >CDataStore < ActorClassEnum, LanderData >< ACTOR_CLASS_LANDER, CLander >< ACTOR_CLASS_MUTANT, CMutant >
When creating the Entity I'd set the pointer to the relevant data...
this->actor_data = CDataStore < ActorClassEnum, CActorData > ::getData(ACTOR_CLASS_LANDER);this->alien_data = CDataStore < ActorClassEnum, CAlienData > ::getData(ACTOR_CLASS_LANDER);this->grunt_data = CDataStore < ActorClassEnum, CLanderData > ::getData(ACTOR_CLASS_LANDER);Seems to work quite well for my needs.Cheers,Paul Cunningham
EDIT - fixed the greater / less than signs
[edited by - PaulCunningham on December 1, 2003 8:19:00 AM]