|
I've got a portion of my system where a lot of entities share one aspect (health), but diverge on other things (such as: some have shields, some are bullets, some have temporary life, etc.) I've been using group tags to determine what kind of group an entity belongs in so I can take appropriate action. For example, when I have bodies collide in the physics engine, I need to determine if the related entity has shields or not, and then apply damage to that or directly to health if shields are not present.
In looking at this, I am wondering about the efficiency of using a tag versus defining an "EntityGroup"-style component that would retrieve this type of information for these entities. What's the benefit of using a tag versus using a component? I think these will accomplish the same thing, but I get the feeling the component approach will induce less overhead.
Thanks, --tim
|