2020-12-08 19:45:24 +00:00
|
|
|
|
using Content.Server.GameObjects.Components.Atmos;
|
|
|
|
|
|
using JetBrains.Annotations;
|
2021-02-11 01:13:03 -08:00
|
|
|
|
using Robust.Shared.GameObjects;
|
2020-12-08 19:45:24 +00:00
|
|
|
|
|
|
|
|
|
|
namespace Content.Server.GameObjects.EntitySystems
|
|
|
|
|
|
{
|
|
|
|
|
|
[UsedImplicitly]
|
|
|
|
|
|
internal sealed class GasCanisterSystem : EntitySystem
|
|
|
|
|
|
{
|
2021-05-13 02:05:46 +02:00
|
|
|
|
public override void Initialize()
|
|
|
|
|
|
{
|
|
|
|
|
|
base.Initialize();
|
|
|
|
|
|
|
|
|
|
|
|
SubscribeLocalEvent<GasCanisterComponent, PhysicsBodyTypeChangedEvent>(OnBodyTypeChanged);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override void Shutdown()
|
|
|
|
|
|
{
|
|
|
|
|
|
base.Shutdown();
|
|
|
|
|
|
|
|
|
|
|
|
UnsubscribeLocalEvent<GasCanisterComponent, PhysicsBodyTypeChangedEvent>();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private static void OnBodyTypeChanged(
|
|
|
|
|
|
EntityUid uid,
|
|
|
|
|
|
GasCanisterComponent component,
|
|
|
|
|
|
PhysicsBodyTypeChangedEvent args)
|
|
|
|
|
|
{
|
|
|
|
|
|
component.AnchorUpdate();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-12-08 19:45:24 +00:00
|
|
|
|
public override void Update(float frameTime)
|
|
|
|
|
|
{
|
2021-02-04 00:20:48 +11:00
|
|
|
|
foreach (var component in ComponentManager.EntityQuery<GasCanisterComponent>(true))
|
2020-12-08 19:45:24 +00:00
|
|
|
|
{
|
|
|
|
|
|
component.Update(frameTime);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|