| 1234567891011121314151617181920212223242526272829303132333435 |
- using System.Linq;
- using Content.Shared.DeviceNetwork.Components;
- namespace Content.Shared.DeviceNetwork.Systems;
- public abstract class SharedDeviceListSystem : EntitySystem
- {
- public IEnumerable<EntityUid> GetAllDevices(EntityUid uid, DeviceListComponent? component = null)
- {
- if (!Resolve(uid, ref component))
- {
- return new EntityUid[] { };
- }
- return component.Devices;
- }
- }
- public sealed class DeviceListUpdateEvent : EntityEventArgs
- {
- public DeviceListUpdateEvent(List<EntityUid> oldDevices, List<EntityUid> devices)
- {
- OldDevices = oldDevices;
- Devices = devices;
- }
- public List<EntityUid> OldDevices { get; }
- public List<EntityUid> Devices { get; }
- }
- public enum DeviceListUpdateResult : byte
- {
- NoComponent,
- TooManyDevices,
- UpdateOk
- }
|