Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 0 additions & 59 deletions Robust.Shared/Prototypes/IPrototypeManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,19 +175,6 @@ bool TryGetInstances<T>([NotNullWhen(true)] out FrozenDictionary<string, T>? ins
/// <seealso cref="TryIndex(EntProtoId,out EntityPrototype?)"/>
bool Resolve([ForbidLiteral] EntProtoId id, [NotNullWhen(true)] out EntityPrototype? prototype);

/// <summary>
/// Retrieve an <see cref="EntityPrototype"/> by ID, optionally logging an error if it does not exist.
/// </summary>
/// <param name="id">The prototype ID to look up.</param>
/// <param name="prototype">The prototype that was resolved, null if it does not exist.</param>
/// <param name="logError">If true (default), log an error if the prototype does not exist.</param>
/// <returns>True if the prototype exists, false if it does not.</returns>
[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);

/// <summary>
/// Resolve an <see cref="EntityPrototype"/> by ID.
/// </summary>
Expand Down Expand Up @@ -236,17 +223,6 @@ bool TryIndex(
/// <seealso cref="TryIndex{T}(ProtoId{T},out T?)"/>
bool Resolve<T>([ForbidLiteral] ProtoId<T> id, [NotNullWhen(true)] out T? prototype) where T : class, IPrototype;

/// <summary>
/// Retrieve a prototype by ID, optionally logging an error if it does not exist.
/// </summary>
/// <param name="id">The prototype ID to look up.</param>
/// <param name="prototype">The prototype that was resolved, null if it does not exist.</param>
/// <param name="logError">If true (default), log an error if the prototype does not exist.</param>
/// <returns>True if the prototype exists, false if it does not.</returns>
[Obsolete("Use Resolve() if you want to get a prototype without throwing but while still logging an error.")]
bool TryIndex<T>([ForbidLiteral] ProtoId<T> id, [NotNullWhen(true)] out T? prototype, bool logError = true)
where T : class, IPrototype;

/// <summary>
/// Resolve a prototype by ID.
/// </summary>
Expand Down Expand Up @@ -299,25 +275,6 @@ bool TryIndex<T>([ForbidLiteral] ProtoId<T> id, [NotNullWhen(true)] out T? proto
/// <seealso cref="TryIndex(EntProtoId?,out EntityPrototype?)"/>
bool Resolve([ForbidLiteral] EntProtoId? id, [NotNullWhen(true)] out EntityPrototype? prototype);

/// <summary>
/// Retrieve an <see cref="EntityPrototype"/> by ID, gracefully handling null,
/// and optionally logging an error if it does not exist.
/// </summary>
/// <remarks>
/// <para>
/// No error is logged if <paramref name="id"/> is null.
/// </para>
/// </remarks>
/// <param name="id">The prototype ID to look up.</param>
/// <param name="prototype">The prototype that was resolved, null if it does not exist.</param>
/// <param name="logError">If true (default), log an error if the prototype does not exist.</param>
/// <returns>True if the prototype exists, false if <paramref name="id"/> was null, or it does not exist.</returns>
[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);

/// <summary>
/// Resolve an <see cref="EntityPrototype"/> by ID, gracefully handling null.
/// </summary>
Expand Down Expand Up @@ -369,22 +326,6 @@ bool TryIndex(
/// <seealso cref="TryIndex{T}(ProtoId{T}?,out T?)"/>
bool Resolve<T>([ForbidLiteral] ProtoId<T>? id, [NotNullWhen(true)] out T? prototype) where T : class, IPrototype;

/// <summary>
/// Retrieve a prototype by ID, gracefully handling null,
/// and optionally logging an error if it does not exist.
/// </summary>
/// <remarks>
/// <para>
/// No error is logged if <paramref name="id"/> is null.
/// </para>
/// </remarks>
/// <param name="id">The prototype ID to look up.</param>
/// <param name="prototype">The prototype that was resolved, null if it does not exist.</param>
/// <param name="logError">If true (default), log an error if the prototype does not exist.</param>
/// <returns>True if the prototype exists, false if <paramref name="id"/> was null, or it does not exist.</returns>
[Obsolete("Use Resolve() if you want to get a prototype without throwing but while still logging an error.")]
bool TryIndex<T>([ForbidLiteral] ProtoId<T>? id, [NotNullWhen(true)] out T? prototype, bool logError = true) where T : class, IPrototype;

/// <summary>
/// Resolve a prototype by ID, gracefully handling null.
/// </summary>
Expand Down
34 changes: 0 additions & 34 deletions Robust.Shared/Prototypes/PrototypeManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -823,15 +815,6 @@ public bool Resolve<T>(ProtoId<T> 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<T>(ProtoId<T> 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<T>(ProtoId<T> id, [NotNullWhen(true)] out T? prototype)
where T : class, IPrototype
{
Expand All @@ -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)
Expand All @@ -879,15 +854,6 @@ public bool Resolve<T>(ProtoId<T>? 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<T>(ProtoId<T>? 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<T>(ProtoId<T>? id, [NotNullWhen(true)] out T? prototype)
where T : class, IPrototype
{
Expand Down
Loading