12-28-2013, 07:30 PM
I think the cComponent class is wrong. There should be a separate class for each category of behavior. Did you read the link that FakeTruth posted? ( http://ai.eecs.umich.edu/soar/Classes/49...umaker.pdf ) Especially pages 37 to 67.
We should have a cMovementComponent, cAttackComponent, cEnvironmentComponent, cInteractionComponent, cAIComponent etc., each having only those callbacks and data relevant to the category; then we'll subclass each component for the specific behavior: cMovementComponent -> cMovementWalking, cMovementWalkingClimbing, cMovementFlying; cAIPassive, cAIAggressive, cAINone (for pickups etc), cAIPlayer(for cPlayer). Then, a cEntity would comprise of these components:
We should have a cMovementComponent, cAttackComponent, cEnvironmentComponent, cInteractionComponent, cAIComponent etc., each having only those callbacks and data relevant to the category; then we'll subclass each component for the specific behavior: cMovementComponent -> cMovementWalking, cMovementWalkingClimbing, cMovementFlying; cAIPassive, cAIAggressive, cAINone (for pickups etc), cAIPlayer(for cPlayer). Then, a cEntity would comprise of these components:
class cEntity { cMovementComponent * m_Movement; cAttackComponent * m_Attack; cEnvironmentComponent * m_Environment; cInteractionComponent * m_Interaction; cAIComponent * m_AI; }I'm not exactly sure if cAttackComponent should be part of the entity, or rather of the cAIAggressive subclass, because that's the only one doing any real attacks. Also not sure about splitting environment and interaction, perhaps they should be together.