12-28-2013, 08:58 PM
So you're thinking that these components should not have a base class? I did read the link that he posted.
I think that environmental and interactions should be split for this reason: While environmental and interaction are both reactions, they are reactions to different sources. Interactions happen between entities, and as such are handled by the cInteractionComponent. Whether or not they take damage when exposed to air, water, lava, or any other type of block is determined by the cEnvironmentComponent. By splitting these up, this allows plugin developers another degree of freedom when designing custom mobs for their plugin.
As for cAttackComponent, I think its perfectly valid to have it as part of cEntity. For instance, wolves would have some sort of passive cAIComponent, but when they are struck by a player/mob (Interaction), they then start attacking the player until they are dead or the player is. Because it is a reactionary action, we can't rely on the AI to handle it.
I think that environmental and interactions should be split for this reason: While environmental and interaction are both reactions, they are reactions to different sources. Interactions happen between entities, and as such are handled by the cInteractionComponent. Whether or not they take damage when exposed to air, water, lava, or any other type of block is determined by the cEnvironmentComponent. By splitting these up, this allows plugin developers another degree of freedom when designing custom mobs for their plugin.
As for cAttackComponent, I think its perfectly valid to have it as part of cEntity. For instance, wolves would have some sort of passive cAIComponent, but when they are struck by a player/mob (Interaction), they then start attacking the player until they are dead or the player is. Because it is a reactionary action, we can't rely on the AI to handle it.