Nuke PowerChangedMessage (#7231)
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
using Content.Server.ParticleAccelerator.Components;
|
||||
using Content.Server.Power.Components;
|
||||
|
||||
namespace Content.Server.ParticleAccelerator.EntitySystems;
|
||||
|
||||
public sealed partial class ParticleAcceleratorSystem
|
||||
{
|
||||
private void InitializeControlBoxSystem()
|
||||
{
|
||||
SubscribeLocalEvent<ParticleAcceleratorControlBoxComponent, PowerChangedEvent>(OnControlBoxPowerChange);
|
||||
}
|
||||
|
||||
private static void OnControlBoxPowerChange(EntityUid uid, ParticleAcceleratorControlBoxComponent component, PowerChangedEvent args)
|
||||
{
|
||||
component.OnPowerStateChanged(args);
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,14 @@
|
||||
using Content.Server.ParticleAccelerator.Components;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
|
||||
namespace Content.Server.ParticleAccelerator.EntitySystems
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public sealed class ParticleAcceleratorPartSystem : EntitySystem
|
||||
public sealed partial class ParticleAcceleratorSystem
|
||||
{
|
||||
public override void Initialize()
|
||||
private void InitializePartSystem()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
EntityManager.EventBus.SubscribeEvent<RotateEvent>(EventSource.Local, this, RotateEvent);
|
||||
SubscribeLocalEvent<ParticleAcceleratorPartComponent, RotateEvent>(OnRotateEvent);
|
||||
SubscribeLocalEvent<ParticleAcceleratorPartComponent, PhysicsBodyTypeChangedEvent>(BodyTypeChanged);
|
||||
}
|
||||
|
||||
@@ -24,12 +20,9 @@ namespace Content.Server.ParticleAccelerator.EntitySystems
|
||||
component.OnAnchorChanged();
|
||||
}
|
||||
|
||||
private void RotateEvent(ref RotateEvent ev)
|
||||
private static void OnRotateEvent(EntityUid uid, ParticleAcceleratorPartComponent component, ref RotateEvent args)
|
||||
{
|
||||
if (EntityManager.TryGetComponent(ev.Sender, out ParticleAcceleratorPartComponent? part))
|
||||
{
|
||||
part.Rotated();
|
||||
}
|
||||
component.Rotated();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,15 +5,11 @@ using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Content.Server.ParticleAccelerator.EntitySystems
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public sealed class ParticleAcceleratorPowerBoxSystem : EntitySystem
|
||||
public sealed partial class ParticleAcceleratorSystem
|
||||
{
|
||||
public override void Initialize()
|
||||
private void InitializePowerBoxSystem()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<ParticleAcceleratorPowerBoxComponent, PowerConsumerReceivedChanged>(
|
||||
PowerBoxReceivedChanged);
|
||||
SubscribeLocalEvent<ParticleAcceleratorPowerBoxComponent, PowerConsumerReceivedChanged>(PowerBoxReceivedChanged);
|
||||
}
|
||||
|
||||
private static void PowerBoxReceivedChanged(
|
||||
@@ -21,8 +17,7 @@ namespace Content.Server.ParticleAccelerator.EntitySystems
|
||||
ParticleAcceleratorPowerBoxComponent component,
|
||||
PowerConsumerReceivedChanged args)
|
||||
{
|
||||
if (component.Master != null)
|
||||
component.Master.PowerBoxReceivedChanged(args);
|
||||
component.Master?.PowerBoxReceivedChanged(args);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
namespace Content.Server.ParticleAccelerator.EntitySystems;
|
||||
|
||||
public sealed partial class ParticleAcceleratorSystem : EntitySystem
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
InitializeControlBoxSystem();
|
||||
InitializePartSystem();
|
||||
InitializePowerBoxSystem();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user