ECS airlocks (#13500)

This commit is contained in:
metalgearsloth
2023-01-18 05:44:32 +11:00
committed by GitHub
parent 8550baa218
commit 2873a830bd
19 changed files with 270 additions and 291 deletions

View File

@@ -1,6 +1,8 @@
using Content.Server.Doors.Components;
using Content.Server.Wires;
using Content.Shared.Doors;
using Content.Shared.Doors.Components;
using Content.Shared.Doors.Systems;
using Content.Shared.Wires;
namespace Content.Server.Doors;
@@ -47,7 +49,7 @@ public sealed class DoorSafetyWireAction : BaseWireAction
if (EntityManager.TryGetComponent<AirlockComponent>(wire.Owner, out var door))
{
WiresSystem.TryCancelWireAction(wire.Owner, PulseTimeoutKey.Key);
door.Safety = false;
EntityManager.System<SharedAirlockSystem>().SetSafety(door, false);
}
return true;
@@ -58,7 +60,7 @@ public sealed class DoorSafetyWireAction : BaseWireAction
base.Mend(user, wire);
if (EntityManager.TryGetComponent<AirlockComponent>(wire.Owner, out var door))
{
door.Safety = true;
EntityManager.System<SharedAirlockSystem>().SetSafety(door, true);
}
return true;
@@ -69,7 +71,7 @@ public sealed class DoorSafetyWireAction : BaseWireAction
base.Pulse(user, wire);
if (EntityManager.TryGetComponent<AirlockComponent>(wire.Owner, out var door))
{
door.Safety = false;
EntityManager.System<SharedAirlockSystem>().SetSafety(door, false);
WiresSystem.StartWireAction(wire.Owner, _timeout, PulseTimeoutKey.Key, new TimedWireEvent(AwaitSafetyTimerFinish, wire));
}
@@ -90,7 +92,7 @@ public sealed class DoorSafetyWireAction : BaseWireAction
{
if (EntityManager.TryGetComponent<AirlockComponent>(wire.Owner, out var door))
{
door.Safety = true;
EntityManager.System<SharedAirlockSystem>().SetSafety(door, true);
}
}
}