From 160df9ee6fba2c5f2683300758995dc2a990304e Mon Sep 17 00:00:00 2001 From: slarticodefast <161409025+slarticodefast@users.noreply.github.com> Date: Sun, 22 Mar 2026 23:43:39 +0100 Subject: [PATCH] remove obsolete TryIndex overloads --- Robust.Shared/Prototypes/IPrototypeManager.cs | 59 ------------------- Robust.Shared/Prototypes/PrototypeManager.cs | 34 ----------- 2 files changed, 93 deletions(-) diff --git a/Robust.Shared/Prototypes/IPrototypeManager.cs b/Robust.Shared/Prototypes/IPrototypeManager.cs index fcb5cedb18e..e800d27f585 100644 --- a/Robust.Shared/Prototypes/IPrototypeManager.cs +++ b/Robust.Shared/Prototypes/IPrototypeManager.cs @@ -175,19 +175,6 @@ bool TryGetInstances([NotNullWhen(true)] out FrozenDictionary? ins /// bool Resolve([ForbidLiteral] EntProtoId id, [NotNullWhen(true)] out EntityPrototype? prototype); - /// - /// Retrieve an by ID, optionally logging an error if it does not exist. - /// - /// The prototype ID to look up. - /// The prototype that was resolved, null if it does not exist. - /// If true (default), log an error if the prototype does not exist. - /// True if the prototype exists, false if it does not. - [Obsolete("Use Resolve() if you want to get a prototype without throwing but while still logging an error.")] - bool TryIndex( - [ForbidLiteral] EntProtoId id, - [NotNullWhen(true)] out EntityPrototype? prototype, - bool logError = true); - /// /// Resolve an by ID. /// @@ -236,17 +223,6 @@ bool TryIndex( /// bool Resolve([ForbidLiteral] ProtoId id, [NotNullWhen(true)] out T? prototype) where T : class, IPrototype; - /// - /// Retrieve a prototype by ID, optionally logging an error if it does not exist. - /// - /// The prototype ID to look up. - /// The prototype that was resolved, null if it does not exist. - /// If true (default), log an error if the prototype does not exist. - /// True if the prototype exists, false if it does not. - [Obsolete("Use Resolve() if you want to get a prototype without throwing but while still logging an error.")] - bool TryIndex([ForbidLiteral] ProtoId id, [NotNullWhen(true)] out T? prototype, bool logError = true) - where T : class, IPrototype; - /// /// Resolve a prototype by ID. /// @@ -299,25 +275,6 @@ bool TryIndex([ForbidLiteral] ProtoId id, [NotNullWhen(true)] out T? proto /// bool Resolve([ForbidLiteral] EntProtoId? id, [NotNullWhen(true)] out EntityPrototype? prototype); - /// - /// Retrieve an by ID, gracefully handling null, - /// and optionally logging an error if it does not exist. - /// - /// - /// - /// No error is logged if is null. - /// - /// - /// The prototype ID to look up. - /// The prototype that was resolved, null if it does not exist. - /// If true (default), log an error if the prototype does not exist. - /// True if the prototype exists, false if was null, or it does not exist. - [Obsolete("Use Resolve() if you want to get a prototype without throwing but while still logging an error.")] - bool TryIndex( - [ForbidLiteral] EntProtoId? id, - [NotNullWhen(true)] out EntityPrototype? prototype, - bool logError = true); - /// /// Resolve an by ID, gracefully handling null. /// @@ -369,22 +326,6 @@ bool TryIndex( /// bool Resolve([ForbidLiteral] ProtoId? id, [NotNullWhen(true)] out T? prototype) where T : class, IPrototype; - /// - /// Retrieve a prototype by ID, gracefully handling null, - /// and optionally logging an error if it does not exist. - /// - /// - /// - /// No error is logged if is null. - /// - /// - /// The prototype ID to look up. - /// The prototype that was resolved, null if it does not exist. - /// If true (default), log an error if the prototype does not exist. - /// True if the prototype exists, false if was null, or it does not exist. - [Obsolete("Use Resolve() if you want to get a prototype without throwing but while still logging an error.")] - bool TryIndex([ForbidLiteral] ProtoId? id, [NotNullWhen(true)] out T? prototype, bool logError = true) where T : class, IPrototype; - /// /// Resolve a prototype by ID, gracefully handling null. /// diff --git a/Robust.Shared/Prototypes/PrototypeManager.cs b/Robust.Shared/Prototypes/PrototypeManager.cs index c727ff6cee9..ce99001a677 100644 --- a/Robust.Shared/Prototypes/PrototypeManager.cs +++ b/Robust.Shared/Prototypes/PrototypeManager.cs @@ -801,14 +801,6 @@ public bool Resolve(EntProtoId id, [NotNullWhen(true)] out EntityPrototype? prot return false; } - [Obsolete("Use Resolve() if you want to get a prototype without throwing but while still logging an error.")] - public bool TryIndex(EntProtoId id, [NotNullWhen(true)] out EntityPrototype? prototype, bool logError = true) - { - if (logError) - return Resolve(id, out prototype); - return TryIndex(id, out prototype); - } - public bool TryIndex([ForbidLiteral] EntProtoId id, [NotNullWhen(true)] out EntityPrototype? prototype) { return TryIndex(id.Id, out prototype); @@ -823,15 +815,6 @@ public bool Resolve(ProtoId id, [NotNullWhen(true)] out T? prototype) wher return false; } - [Obsolete("Use Resolve() if you want to get a prototype without throwing but while still logging an error.")] - public bool TryIndex(ProtoId id, [NotNullWhen(true)] out T? prototype, bool logError = true) - where T : class, IPrototype - { - if (logError) - return Resolve(id, out prototype); - return TryIndex(id, out prototype); - } - public bool TryIndex(ProtoId id, [NotNullWhen(true)] out T? prototype) where T : class, IPrototype { @@ -849,14 +832,6 @@ public bool Resolve(EntProtoId? id, [NotNullWhen(true)] out EntityPrototype? pro return Resolve(id.Value, out prototype); } - [Obsolete("Use Resolve() if you want to get a prototype without throwing but while still logging an error.")] - public bool TryIndex(EntProtoId? id, [NotNullWhen(true)] out EntityPrototype? prototype, bool logError = true) - { - if (logError) - return Resolve(id, out prototype); - return TryIndex(id, out prototype); - } - public bool TryIndex(EntProtoId? id, [NotNullWhen(true)] out EntityPrototype? prototype) { if (id == null) @@ -879,15 +854,6 @@ public bool Resolve(ProtoId? id, [NotNullWhen(true)] out T? prototype) whe return Resolve(id.Value, out prototype); } - [Obsolete("Use Resolve() if you want to get a prototype without throwing but while still logging an error.")] - public bool TryIndex(ProtoId? id, [NotNullWhen(true)] out T? prototype, bool logError = true) - where T : class, IPrototype - { - if (logError) - return Resolve(id, out prototype); - return TryIndex(id, out prototype); - } - public bool TryIndex(ProtoId? id, [NotNullWhen(true)] out T? prototype) where T : class, IPrototype {