using Robust.Shared.GameStates;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Shared.Timing;
///
/// Timer that creates a cooldown each time an object is activated/used
///
///
/// Currently it only supports a single delay per entity, this means that for things that have two delay interactions they will share one timer, so this can cause issues. For example, the bible has a delay when opening the storage UI and when applying it's interaction effect, and they share the same delay.
///
[RegisterComponent]
[NetworkedComponent, AutoGenerateComponentState]
[Access(typeof(UseDelaySystem))]
public sealed partial class UseDelayComponent : Component
{
///
/// When the delay starts.
///
[ViewVariables(VVAccess.ReadWrite), DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoNetworkedField]
public TimeSpan DelayStartTime;
///
/// When the delay ends.
///
[ViewVariables(VVAccess.ReadWrite), DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoNetworkedField]
public TimeSpan DelayEndTime;
///
/// Default delay time
///
[DataField]
[ViewVariables(VVAccess.ReadWrite)]
[AutoNetworkedField]
public TimeSpan Delay = TimeSpan.FromSeconds(1);
}