#nullable enable using System; using Content.Shared.ActionBlocker; using JetBrains.Annotations; using Robust.Shared.GameObjects; namespace Content.Shared.EffectBlocker { /// /// Utility methods to check if an effect is allowed to affect a specific entity. /// For actions see /// [UsedImplicitly] public class EffectBlockerSystem : EntitySystem { public static bool CanFall(IEntity entity) { var canFall = true; foreach (var blocker in entity.GetAllComponents()) { canFall &= blocker.CanFall(); // Sets var to false if false } return canFall; } public static bool CanSlip(IEntity entity) { var canSlip = true; foreach (var blocker in entity.GetAllComponents()) { canSlip &= blocker.CanSlip(); // Sets var to false if false } return canSlip; } } }