#nullable enable using System.Diagnostics.CodeAnalysis; using Robust.Shared.Interfaces.GameObjects; namespace Content.Shared.GameObjects.Components.Body { public static class BodyExtensions { public static T? GetBody(this IEntity entity) where T : class, IBody { return entity.GetComponentOrNull(); } public static bool TryGetBody(this IEntity entity, [NotNullWhen(true)] out T? body) where T : class, IBody { return (body = entity.GetBody()) != null; } public static IBody? GetBody(this IEntity entity) { return entity.GetComponentOrNull(); } public static bool TryGetBody(this IEntity entity, [NotNullWhen(true)] out IBody? body) { return (body = entity.GetBody()) != null; } } }