using System.Numerics;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Shared.Chasm;
///
/// Added to entities which have started falling into an entity with .
///
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState, AutoGenerateComponentPause]
public sealed partial class ChasmFallingComponent : Component
{
///
/// The entity with this entity is falling into.
///
[DataField, AutoNetworkedField]
public EntityUid FallingInto;
///
/// Time it should take for the falling animation (scaling down) to complete.
///
[DataField, AutoNetworkedField]
public TimeSpan AnimationTime = TimeSpan.FromSeconds(1.5f);
///
/// Time it should take in seconds for the entity to actually delete
///
[DataField, AutoNetworkedField]
public TimeSpan DeletionTime = TimeSpan.FromSeconds(1.8f);
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
[AutoPausedField, AutoNetworkedField]
public TimeSpan NextDeletionTime = TimeSpan.Zero;
///
/// Original scale of the object so it can be restored if the component is removed in the middle of the animation
///
[AutoNetworkedField]
public Vector2 OriginalScale = Vector2.Zero;
///
/// Scale that the animation should bring entities to.
///
[AutoNetworkedField]
public Vector2 AnimationScale = new(0.01f, 0.01f);
}