Mark EntityPrototypeHelpers as obsolete (#42626)

Co-authored-by: Whatstone <166147148+whatston3@users.noreply.github.com>
This commit is contained in:
deltanedas 2026-07-24 08:35:00 +01:00 • committed by GitHub
parent 6abd18bd51
commit bd35620846
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4,13 +4,16 @@ using Robust.Shared.Prototypes;
namespace Content.Shared.Prototypes
{
[UsedImplicitly]
[Obsolete("More efficient methods exist in EntityPrototype.HasComp and EntitySystem's proxy methods")]
public static class EntityPrototypeHelpers
{
[Obsolete("More efficient methods exist in EntityPrototype.HasComp and EntitySystem's proxy methods")]
public static bool HasComponent<T>(this EntityPrototype prototype, IComponentFactory? componentFactory = null) where T : IComponent
{
return prototype.HasComponent(typeof(T), componentFactory);
}
[Obsolete("More efficient methods exist in EntityPrototype.HasComp and EntitySystem's proxy methods")]
public static bool HasComponent(this EntityPrototype prototype, Type component, IComponentFactory? componentFactory = null)
{
componentFactory ??= IoCManager.Resolve<IComponentFactory>();
@ -20,11 +23,13 @@ namespace Content.Shared.Prototypes
return prototype.Components.ContainsKey(registration.Name);
}
[Obsolete("More efficient methods exist in EntityPrototype.HasComp and EntitySystem's proxy methods")]
public static bool HasComponent<T>(string prototype, IPrototypeManager? prototypeManager = null, IComponentFactory? componentFactory = null) where T : IComponent
{
return HasComponent(prototype, typeof(T), prototypeManager, componentFactory);
}
[Obsolete("More efficient methods exist in EntityPrototype.HasComp and EntitySystem's proxy methods")]
public static bool HasComponent(string prototype, Type component, IPrototypeManager? prototypeManager = null, IComponentFactory? componentFactory = null)
{
prototypeManager ??= IoCManager.Resolve<IPrototypeManager>();