Delta-v/Content.Server/UserInterface/UserInterfaceHelpers.cs

15 lines
456 B
C#

using Robust.Server.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
namespace Content.Server.UserInterface
{
public static class UserInterfaceHelpers
{
public static BoundUserInterface? GetUIOrNull(this EntityUid entity, object uiKey)
{
return IoCManager.Resolve<IEntityManager>().GetComponentOrNull<ServerUserInterfaceComponent>(entity)?.GetBoundUserInterfaceOrNull(uiKey);
}
}
}