using System.Numerics;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
namespace Content.Shared._Emberfall.Weapons.Ranged;
///
/// Added to projectiles to give them tracer effects
///
[RegisterComponent, NetworkedComponent]
public sealed partial class TracerComponent : Component
{
///
/// How long the tracer effect should remain visible for after firing
///
[DataField]
public float Lifetime = 10f;
///
/// The maximum length of the tracer trail
///
[DataField]
public float Length = 2f;
///
/// Color of the tracer line effect
///
[DataField]
public Color Color = Color.Red;
[ViewVariables]
public TracerData Data = default!;
}
[Serializable, NetSerializable, DataRecord]
public struct TracerData(List positionHistory, TimeSpan endTime)
{
///
/// The history of positions this tracer has moved through
///
public List PositionHistory = positionHistory;
///
/// When this tracer effect should end
///
public TimeSpan EndTime = endTime;
}