What is your question ? ... Whatever...
1. Does it make sense to create abstract classes even if the parent class is not abstract ?
Yes, it makes sense if you start a new type of sub hierarchy, like you already said. Scenenode is not abstract, but actor is, this is ok. In this case actor introduces a new kind of object-class with a specific behaviour.
2. Does it make sense to add behaviour to a certain class by adding a new interface ?
Yes and no. A interface should be a interface nothing more. Your IWeapon interface is fine, use interfaces in this way. It is not a new behaviour, but a new interface to your object. Don't do something like ILaserWeapon, IPulseWeapon, IMeleeWeapon, these are just diffenent behaviours which should be accessed through a single interface.
3. Is there a better way to add different behaviour to an object ?
Hmmm....yes... it depends..
You can use delegation. I.e. create a IBehaviourInterface which will implement a certain kind of behaviour (AI, Weaponbehaviour).
class IBehaviourInterface{public: void doSomething() = 0;}class StupidOrcBehaviour : IBehaviourInterface{public: void doSomething() {call script "stupid_orc_behaviour"}}class Actor : Scenenode{private: IBehaviourInterface* myBehaviour;public: void doSomething() { if(myBehaviour!=NULL){myBehaviour->doSomething();}}}
4. Now, when to use what ?
Use 1 for your base hierarchy. You have already done quite well.
Use 2 for interfaces, not behaviour. Good interfaces are:
- IRender
- IOrder
- IControl
Use 3 for certain behaviours:
- movementbehaviour
- AI-Behaviour
- weaponbehaviour
--
Ashaman