I’m in trouble concerning entity design. I wish an advise on “complex” component. I’m working on m’y spaceships, which are entities. Spaceships as weapons, with type, hitpoints,target,… but spaceships can have multiple weapon of same type, e.g. 5 phaser and 2 photon. As they can have different targets, I can’t just accumulate values in one component per type. As components are unique, I can’t put many of them.
So the question is what is the best design :
*a Weapons component that hold a map of class, and follow should hold class be component (if there is only one weapon, no need to create à composite)
*each weapon is an independant entity, with components for hitpoints, target, parent, etc.
For now, I’ve no opinion. Maybe the second one is heavier. If someone can help.