Files
tbd-station-14/Content.Server/Atmos/EntitySystems/AirtightSystem.cs
Acruid 15fb554c28 Engine Entity Anchoring Changes (#4195)
* Converted all SnapGridPositionChangedEvent subscriptions to AnchorStateChangedEvent.

* Fixes power tests with new anchored requirements.

* Moved AnchorableComponent into construction.
AnchorableComponent now uses Transform.Anchored.

* Fixed bug with nodes, power works again.

* Adds lifetime stages to Component.

* Update Engine to v0.4.70.
2021-06-19 19:41:26 -07:00

27 lines
824 B
C#

using Content.Server.Atmos.Components;
using JetBrains.Annotations;
using Robust.Shared.GameObjects;
namespace Content.Server.Atmos.EntitySystems
{
[UsedImplicitly]
public class AirtightSystem : EntitySystem
{
public override void Initialize()
{
SubscribeLocalEvent<AirtightComponent, AnchorStateChangedEvent>(OnAirtightPositionChanged);
SubscribeLocalEvent<AirtightComponent, RotateEvent>(OnAirtightRotated);
}
private void OnAirtightPositionChanged(EntityUid uid, AirtightComponent component, AnchorStateChangedEvent args)
{
component.AnchorStateChanged();
}
private void OnAirtightRotated(EntityUid uid, AirtightComponent airtight, RotateEvent ev)
{
airtight.RotateEvent(ev);
}
}
}