Files
tbd-station-14/Content.Server/Destructible/Thresholds/Behaviors/OpenBehavior.cs
Kara 993eef1e7c Resolve 'EntitySystem.Get<T>()' is obsolete in content (#27936)
* PROJECT 0 WARNINGS: Resolve `'EntitySystem.Get<T>()' is obsolete` in content

* pass entman

* dog ass test

* webeditor
2024-05-12 20:34:52 -04:00

18 lines
544 B
C#

using Content.Shared.Nutrition.EntitySystems;
namespace Content.Server.Destructible.Thresholds.Behaviors;
/// <summary>
/// Causes the drink/food to open when the destruction threshold is reached.
/// If it is already open nothing happens.
/// </summary>
[DataDefinition]
public sealed partial class OpenBehavior : IThresholdBehavior
{
public void Execute(EntityUid uid, DestructibleSystem system, EntityUid? cause = null)
{
var openable = system.EntityManager.System<OpenableSystem>();
openable.TryOpen(uid);
}
}