RepeatingTriggerComponent.cs 821 B

12345678910111213141516171819202122232425
  1. using Content.Server.Explosion.EntitySystems;
  2. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
  3. namespace Content.Server.Explosion.Components;
  4. /// <summary>
  5. /// Constantly triggers after being added to an entity.
  6. /// </summary>
  7. [RegisterComponent, Access(typeof(TriggerSystem))]
  8. [AutoGenerateComponentPause]
  9. public sealed partial class RepeatingTriggerComponent : Component
  10. {
  11. /// <summary>
  12. /// How long to wait between triggers.
  13. /// The first trigger starts this long after the component is added.
  14. /// </summary>
  15. [DataField]
  16. public TimeSpan Delay = TimeSpan.FromSeconds(1);
  17. /// <summary>
  18. /// When the next trigger will be.
  19. /// </summary>
  20. [DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoPausedField]
  21. public TimeSpan NextTrigger;
  22. }