using ET.EventType; using System; using System.Collections.Generic; using System.Text; namespace ET { public class UnitComponentAeakeSystem : AwakeSystem { public override void Awake(UnitComponent self) { self.Awake(); } } public class UnitComponentDestroySystem : DestroySystem { public override void Destroy(UnitComponent self) { self.idUnits.Clear(); } } public static class UnitComponentSystem { public static void Awake(this UnitComponent self) { } public static void Add(this UnitComponent self, Unit unit) { self.idUnits[unit.Id] = unit; } public static Unit Get(this UnitComponent self, long id) { self.idUnits.TryGetValue(id, out Unit unit); return unit; } public static void Remove(this UnitComponent self, long id) { self.idUnits.Remove(id); } public static void RemoveNoDispose(this UnitComponent self, long id) { self.idUnits.Remove(id); } public static IEnumerable GetAll(this UnitComponent self) { return self.idUnits.Values; } } }