Remove disposal tubes component references and ECS some of it (#15188)
This commit is contained in:
@@ -6,14 +6,12 @@ using Content.Server.Disposal.Unit.EntitySystems;
|
||||
namespace Content.Server.Disposal.Tube.Components
|
||||
{
|
||||
[RegisterComponent]
|
||||
[ComponentReference(typeof(IDisposalTubeComponent))]
|
||||
[ComponentReference(typeof(DisposalTubeComponent))]
|
||||
public sealed class DisposalEntryComponent : DisposalTubeComponent
|
||||
[Access(typeof(DisposalTubeSystem), typeof(DisposalUnitSystem))]
|
||||
public sealed class DisposalEntryComponent : Component
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entMan = default!;
|
||||
|
||||
private const string HolderPrototypeId = "DisposalHolder";
|
||||
public override string ContainerId => "DisposalEntry";
|
||||
|
||||
public bool TryInsert(DisposalUnitComponent from, IEnumerable<string>? tags = default)
|
||||
{
|
||||
@@ -31,25 +29,7 @@ namespace Content.Server.Disposal.Tube.Components
|
||||
if (tags != default)
|
||||
holderComponent.Tags.UnionWith(tags);
|
||||
|
||||
return EntitySystem.Get<DisposableSystem>().EnterTube((holderComponent).Owner, Owner, holderComponent, null, this);
|
||||
}
|
||||
|
||||
protected override Direction[] ConnectableDirections()
|
||||
{
|
||||
return new[] {_entMan.GetComponent<TransformComponent>(Owner).LocalRotation.GetDir()};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ejects contents when they come from the same direction the entry is facing.
|
||||
/// </summary>
|
||||
public override Direction NextDirection(DisposalHolderComponent holder)
|
||||
{
|
||||
if (holder.PreviousDirectionFrom != Direction.Invalid)
|
||||
{
|
||||
return Direction.Invalid;
|
||||
}
|
||||
|
||||
return ConnectableDirections()[0];
|
||||
return EntitySystem.Get<DisposableSystem>().EnterTube((holderComponent).Owner, Owner, holderComponent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user