using Content.Shared.DeviceNetwork.Components; namespace Content.Shared.DeviceNetwork.Systems; /// public abstract class SharedDeviceNetworkJammerSystem : EntitySystem { /// /// Sets the range of the jamming effect. /// public void SetRange(Entity ent, float value) { ent.Comp.Range = value; Dirty(ent); } /// public bool TrySetRange(Entity ent, float value) { if (!Resolve(ent, ref ent.Comp, logMissing: false)) return false; SetRange((ent, ent.Comp), value); return true; } /// /// Returns the set of networks that this entity can jam. public IReadOnlySet GetJammableNetworks(Entity ent) { return ent.Comp.JammableNetworks; } /// /// Enables this entity to jam packets on the specified network. /// public void AddJammableNetwork(Entity ent, string networkId) { if (ent.Comp.JammableNetworks.Add(networkId)) Dirty(ent); } /// /// Stops this entity from jamming packets on the specified network. /// public void RemoveJammableNetwork(Entity ent, string networkId) { if (ent.Comp.JammableNetworks.Remove(networkId)) Dirty(ent); } /// /// Stops this entity from jamming packets on any networks. /// public void ClearJammableNetworks(Entity ent) { if (ent.Comp.JammableNetworks.Count == 0) return; ent.Comp.JammableNetworks.Clear(); Dirty(ent); } }