Refactor UserInterface properties to use a helper (#1896)

This commit is contained in:
DrSmugleaf
2020-08-24 20:47:17 +02:00
committed by GitHub
parent d9f02a6a0a
commit 520e523d30
29 changed files with 76 additions and 166 deletions

View File

@@ -0,0 +1,14 @@
#nullable enable
using Robust.Server.GameObjects.Components.UserInterface;
using Robust.Shared.Interfaces.GameObjects;
namespace Content.Server.Utility
{
public static class UserInterfaceHelpers
{
public static BoundUserInterface? GetUIOrNull(this IEntity entity, object uiKey)
{
return entity.GetComponentOrNull<ServerUserInterfaceComponent>()?.GetBoundUserInterfaceOrNull(uiKey);
}
}
}