Remove disposal tubes component references and ECS some of it (#15188)
This commit is contained in:
@@ -3,13 +3,11 @@ using Content.Server.Disposal.Tube.Components;
|
||||
using Content.Shared.Body.Components;
|
||||
using Content.Shared.Item;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.Physics;
|
||||
using Robust.Shared.Physics.Components;
|
||||
using Robust.Shared.Physics.Systems;
|
||||
|
||||
namespace Content.Server.Disposal.Unit.Components
|
||||
{
|
||||
// TODO: Add gas
|
||||
[RegisterComponent]
|
||||
public sealed class DisposalHolderComponent : Component, IGasMixtureHolder
|
||||
{
|
||||
@@ -31,7 +29,7 @@ namespace Content.Server.Disposal.Unit.Components
|
||||
public float TimeLeft { get; set; }
|
||||
|
||||
[ViewVariables]
|
||||
public IDisposalTubeComponent? PreviousTube { get; set; }
|
||||
public DisposalTubeComponent? PreviousTube { get; set; }
|
||||
|
||||
[ViewVariables]
|
||||
public Direction PreviousDirection { get; set; } = Direction.Invalid;
|
||||
@@ -40,7 +38,7 @@ namespace Content.Server.Disposal.Unit.Components
|
||||
public Direction PreviousDirectionFrom => (PreviousDirection == Direction.Invalid) ? Direction.Invalid : PreviousDirection.GetOpposite();
|
||||
|
||||
[ViewVariables]
|
||||
public IDisposalTubeComponent? CurrentTube { get; set; }
|
||||
public DisposalTubeComponent? CurrentTube { get; set; }
|
||||
|
||||
// CurrentDirection is not null when CurrentTube isn't null.
|
||||
[ViewVariables]
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
using System.Linq;
|
||||
using Content.Server.Atmos.EntitySystems;
|
||||
using Content.Server.Disposal.Tube.Components;
|
||||
using Content.Server.Disposal.Tube;
|
||||
using Content.Server.Disposal.Tube.Components;
|
||||
using Content.Server.Disposal.Unit.Components;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Physics;
|
||||
using Robust.Shared.Physics.Systems;
|
||||
using Robust.Shared.Physics.Components;
|
||||
using Robust.Shared.Physics.Systems;
|
||||
|
||||
namespace Content.Server.Disposal.Unit.EntitySystems
|
||||
{
|
||||
@@ -90,7 +88,7 @@ namespace Content.Server.Disposal.Unit.EntitySystems
|
||||
}
|
||||
|
||||
// Note: This function will cause an ExitDisposals on any failure that does not make an ExitDisposals impossible.
|
||||
public bool EnterTube(EntityUid holderUid, EntityUid toUid, DisposalHolderComponent? holder = null, TransformComponent? holderTransform = null, IDisposalTubeComponent? to = null, TransformComponent? toTransform = null)
|
||||
public bool EnterTube(EntityUid holderUid, EntityUid toUid, DisposalHolderComponent? holder = null, TransformComponent? holderTransform = null, DisposalTubeComponent? to = null, TransformComponent? toTransform = null)
|
||||
{
|
||||
if (!Resolve(holderUid, ref holder, ref holderTransform))
|
||||
return false;
|
||||
@@ -124,7 +122,9 @@ namespace Content.Server.Disposal.Unit.EntitySystems
|
||||
holder.PreviousDirection = holder.CurrentDirection;
|
||||
}
|
||||
holder.CurrentTube = to;
|
||||
holder.CurrentDirection = to.NextDirection(holder);
|
||||
var ev = new GetDisposalsNextDirectionEvent(holder);
|
||||
RaiseLocalEvent(toUid, ref ev);
|
||||
holder.CurrentDirection = ev.Next;
|
||||
holder.StartingTime = 0.1f;
|
||||
holder.TimeLeft = 0.1f;
|
||||
// Logger.InfoS("c.s.disposal.holder", $"Disposals dir {holder.CurrentDirection}");
|
||||
@@ -192,7 +192,7 @@ namespace Content.Server.Disposal.Unit.EntitySystems
|
||||
}
|
||||
|
||||
// Perform remainder of entry process
|
||||
if (!EnterTube((holder).Owner, nextTube.Owner, holder, null, nextTube, null))
|
||||
if (!EnterTube((holder).Owner, nextTube.Owner, holder))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user