Remove disposal tubes component references and ECS some of it (#15188)

This commit is contained in:
DrSmugleaf
2023-04-06 20:20:50 -07:00
committed by GitHub
parent 9ee1c61ca2
commit 97a8b64c1d
16 changed files with 261 additions and 233 deletions

View File

@@ -1,4 +1,3 @@
using Content.Server.Disposal.Unit.Components;
using Content.Server.UserInterface;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
@@ -10,12 +9,9 @@ using static Content.Shared.Disposal.Components.SharedDisposalRouterComponent;
namespace Content.Server.Disposal.Tube.Components
{
[RegisterComponent]
[ComponentReference(typeof(IDisposalTubeComponent))]
[ComponentReference(typeof(DisposalTubeComponent))]
[Access(typeof(DisposalTubeSystem))]
public sealed class DisposalRouterComponent : DisposalJunctionComponent
{
public override string ContainerId => "DisposalRouter";
[Dependency] private readonly IEntityManager _entMan = default!;
[DataField("tags")]
@@ -30,18 +26,6 @@ namespace Content.Server.Disposal.Tube.Components
[DataField("clickSound")] private SoundSpecifier _clickSound = new SoundPathSpecifier("/Audio/Machines/machine_switch.ogg");
public override Direction NextDirection(DisposalHolderComponent holder)
{
var directions = ConnectableDirections();
if (holder.Tags.Overlaps(Tags))
{
return directions[1];
}
return _entMan.GetComponent<TransformComponent>(Owner).LocalRotation.GetDir();
}
protected override void Initialize()
{
base.Initialize();