Converts the particle accelerator over to ECS + misc (#17075)
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
@@ -1,39 +1,8 @@
|
||||
namespace Content.Server.ParticleAccelerator.Components
|
||||
namespace Content.Server.ParticleAccelerator.Components;
|
||||
|
||||
[RegisterComponent]
|
||||
public sealed class ParticleAcceleratorPartComponent : Component
|
||||
{
|
||||
[RegisterComponent]
|
||||
[Virtual]
|
||||
public class ParticleAcceleratorPartComponent : Component
|
||||
{
|
||||
[ViewVariables] public ParticleAcceleratorControlBoxComponent? Master;
|
||||
|
||||
protected override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
// FIXME: this has to be an entity system, full stop.
|
||||
|
||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner).Anchored = true;
|
||||
}
|
||||
|
||||
public void OnAnchorChanged()
|
||||
{
|
||||
RescanIfPossible();
|
||||
}
|
||||
|
||||
protected override void OnRemove()
|
||||
{
|
||||
base.OnRemove();
|
||||
|
||||
RescanIfPossible();
|
||||
}
|
||||
|
||||
private void RescanIfPossible()
|
||||
{
|
||||
Master?.RescanParts();
|
||||
}
|
||||
|
||||
public void Moved()
|
||||
{
|
||||
RescanIfPossible();
|
||||
}
|
||||
}
|
||||
[ViewVariables]
|
||||
public EntityUid? Master;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user