using Robust.Shared.Prototypes; using Robust.Shared.Serialization; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Set; namespace Content.Shared.DeviceLinking; /// /// A prototype for a device port, for use with device linking. /// [Serializable, NetSerializable] public abstract class DevicePortPrototype { [IdDataField] public string ID { get; private set; } = default!; /// /// Localization string for the port name. Displayed in the linking UI. /// [DataField("name", required:true)] public string Name = default!; /// /// Localization string for a description of the ports functionality. Should either indicate when a source /// port is fired, or what function a sink port serves. Displayed as a tooltip in the linking UI. /// [DataField("description", required: true)] public string Description = default!; } [Prototype] [Serializable, NetSerializable] public sealed partial class SinkPortPrototype : DevicePortPrototype, IPrototype { } [Prototype] [Serializable, NetSerializable] public sealed partial class SourcePortPrototype : DevicePortPrototype, IPrototype { /// /// This is a set of sink ports that this source port will attempt to link to when using the /// default-link functionality. /// [DataField("defaultLinks", customTypeSerializer: typeof(PrototypeIdHashSetSerializer))] public HashSet? DefaultLinks; }