using Content.Shared.Damage; using Content.Shared.Silicons.Borgs.Components; namespace Content.Shared.Silicons.Borgs; public abstract partial class SharedBorgSystem { public void InitializeRelay() { SubscribeLocalEvent(RelayToModule); } protected void RelayToModule(EntityUid uid, BorgChassisComponent component, T args) where T : class { var ev = new BorgModuleRelayedEvent(args); foreach (var module in component.ModuleContainer.ContainedEntities) { RaiseLocalEvent(module, ref ev); } } protected void RelayRefToModule(EntityUid uid, BorgChassisComponent component, ref T args) where T : class { var ev = new BorgModuleRelayedEvent(args); foreach (var module in component.ModuleContainer.ContainedEntities) { RaiseLocalEvent(module, ref ev); } } } [ByRefEvent] public record struct BorgModuleRelayedEvent(TEvent Args) { public readonly TEvent Args = Args; }