mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 10:21:18 +03:00
Mark EntityPrototypeHelpers as obsolete (#42626)
Co-authored-by: Whatstone <166147148+whatston3@users.noreply.github.com>
This commit is contained in:
parent
6abd18bd51
commit
bd35620846
1 changed files with 5 additions and 0 deletions
|
|
@ -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>();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue