using System.Diagnostics.CodeAnalysis; using JetBrains.Annotations; namespace Robust.Shared.Prototypes; /// /// Extension methods for working with . /// [PublicAPI] public static class PrototypeManagerExt { /// /// Index for a by ID, returning null if the ID is null. /// /// /// The prototype ID to look up. /// The kind of prototype to look up. /// The prototype, or null if is . /// /// Thrown if the prototype ID given is invalid. /// [return: NotNullIfNotNull(nameof(protoId))] public static T? Index(this IPrototypeManager prototypeManager, ProtoId? protoId) where T : class, IPrototype { return protoId is null ? null : prototypeManager.Index(protoId.Value); } }