* Engine namespace changes.
* Automated remove redundant using statements.
* Simplified Graphics namespace.
* Apparently the container system stores full type names in the map file.😞 This updates those names.
* API Changes to LocalizationManager.LoadCulture.
* Update submodule to v0.3.2
39 lines
1.1 KiB
C#
39 lines
1.1 KiB
C#
using Content.Shared.GameObjects.EntitySystems.ActionBlocker;
|
|
using JetBrains.Annotations;
|
|
using Robust.Shared.GameObjects;
|
|
|
|
namespace Content.Shared.GameObjects.EntitySystems.EffectBlocker
|
|
{
|
|
/// <summary>
|
|
/// Utility methods to check if an effect is allowed to affect a specific entity.
|
|
/// For actions see <see cref="ActionBlockerSystem"/>
|
|
/// </summary>
|
|
[UsedImplicitly]
|
|
public class EffectBlockerSystem : EntitySystem
|
|
{
|
|
public static bool CanFall(IEntity entity)
|
|
{
|
|
var canFall = true;
|
|
|
|
foreach (var blocker in entity.GetAllComponents<IEffectBlocker>())
|
|
{
|
|
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<IEffectBlocker>())
|
|
{
|
|
canSlip &= blocker.CanSlip(); // Sets var to false if false
|
|
}
|
|
|
|
return canSlip;
|
|
}
|
|
}
|
|
}
|