Files
tbd-station-14/Content.Server/Cargo/Components/CargoTelepadComponent.cs
metalgearsloth 334568dad2 ECS cargo telepad and cleanup (#6450)
Co-authored-by: metalgearsloth <metalgearsloth@gmail.com>
2022-02-15 15:01:45 +11:00

39 lines
1.3 KiB
C#

using Content.Shared.Cargo;
using Content.Shared.Cargo.Components;
using Content.Shared.Sound;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Server.Cargo.Components
{
/// <summary>
/// Handles teleporting in requested cargo after the specified delay.
/// </summary>
[RegisterComponent, Friend(typeof(CargoSystem))]
public sealed class CargoTelepadComponent : SharedCargoTelepadComponent
{
[DataField("delay")]
public float Delay = 20f;
/// <summary>
/// How much time we've accumulated until next teleport.
/// </summary>
[ViewVariables]
public float Accumulator = 0f;
[ViewVariables]
public readonly Stack<CargoOrderData> TeleportQueue = new();
[ViewVariables]
public CargoTelepadState CurrentState = CargoTelepadState.Unpowered;
[DataField("teleportSound")] public SoundSpecifier TeleportSound = new SoundPathSpecifier("/Audio/Machines/phasein.ogg");
/// <summary>
/// The paper-type prototype to spawn with the order information.
/// </summary>
[DataField("printerOutput", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
public string PrinterOutput = "Paper";
}
}