Hi guys. I'm struggling to understand what I guess is a fundamental concept. Let me explain what I want to do, and how I'd do it in a monobehaviour setting.
I'd have a Squad class with an ID (integer), let's say "1". Each squad class would have a list of members (Unit class), and each unit object would have a reference back to it's squad.
This way if a squad member gets hit, I could refer to its squad, and iterate through each member, telling them to attack the guy who just hit one of their squad members.
In my ECS system each entity has a SquadData component, that contains their squad id. If a unit gets hit, I add to it EventUnitAttacked component like so:
Ecb.AddComponent<EventUnitAttacked>(combat.Target, new EventUnitAttacked
{
AttackingEntity = entity,
AttackingSquad = squadData.SquadId
});```
Now how the heck do I write a job, which basically does what I described above? I'm just looking for the Execute definition I guess, or some help with understanding the concept. Obviously not looking for the whole implementation. Thanks a lot!