using Entitas; namespace CoreGame.Render { [Combat] public class LifeBindMeComponent : IComponent, IReset { public CombatEntity owner; internal readonly TArray children = new(4); public void AddChild(int eid, bool forceRefresh = true) { if (forceRefresh) { for (int i = children.Count - 1; i >= 0; i--) { var child = children[i]; if (Contexts.Combat.GetEntity(child) == null) children.RemoveAt(i); } } children.Add(eid); } public bool RemoveChild(int eid) { for (int i = 0; i < children.Count; i++) { if (children[i] == eid) { children.RemoveAt(i); return true; } } return false; } public void Reset() { children.Clear(); } } }