What do you think of that inheritance hierarchy?


Agreed.Halifax wrote:Hmm, well that diagram is definitely a little simplistic. As my first suggestion, I would say you should rename 'character' to 'actor'.
Second off, a building should not only be static. And also depending on your definition of mountable, a building can be "mountable". Also 'movable' implies 'flyable' so I would just implement a 'moveable' class in which constraints could be set to make the entity 'flyable'/'drivable' etc.
Those are just my suggestions/ideas.

It seems you've posted that while I was writing my post or something so my response to that is that its not a game but a game engine hence needs to be as generally/generically as it can.Saturn wrote:To little info to give specific advice, so it has to be more general. I tend to agree with FuzzYspo0N in that it is probably unnecessarily complex.
But if you want specific help, you need to tell us what actual game entities there are in your game, what kind of game it is and what interaction there is between the game entities among each other.
You have a single multiple inheritance here for vehicle. I'd try to eliminate it, not worth the bother, if it is only applicable for a single instance.
The question is, what the functional difference between these classes? What specifically do you need to distinct movable and item for, for instance?
What is a movable anyway? It seems to me that you try to press everything into a class hierarchy, that can be more generally solved with composition.
Are you talking about the way the scene graph works or just about having a simple One class to describe an entity? (and that's for you and JP:Halifax wrote:I believe you should only implement an entity, as Irrlicht implements scene nodes, then just build your entities on top of that and make them available to the user.
Code: Select all
IGameEntity
IGameEntityModifier