StationCargoBountyDatabaseComponent.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. using Content.Shared.Cargo;
  2. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
  3. namespace Content.Server.Cargo.Components;
  4. /// <summary>
  5. /// Stores all active cargo bounties for a particular station.
  6. /// </summary>
  7. [RegisterComponent]
  8. public sealed partial class StationCargoBountyDatabaseComponent : Component
  9. {
  10. /// <summary>
  11. /// Maximum amount of bounties a station can have.
  12. /// </summary>
  13. [DataField]
  14. public int MaxBounties = 6;
  15. /// <summary>
  16. /// A list of all the bounties currently active for a station.
  17. /// </summary>
  18. [DataField]
  19. public List<CargoBountyData> Bounties = new();
  20. /// <summary>
  21. /// A list of all the bounties that have been completed or
  22. /// skipped for a station.
  23. /// </summary>
  24. [DataField]
  25. public List<CargoBountyHistoryData> History = new();
  26. /// <summary>
  27. /// Used to determine unique order IDs
  28. /// </summary>
  29. [DataField]
  30. public int TotalBounties;
  31. /// <summary>
  32. /// A list of bounty IDs that have been checked this tick.
  33. /// Used to prevent multiplying bounty prices.
  34. /// </summary>
  35. [DataField]
  36. public HashSet<string> CheckedBounties = new();
  37. /// <summary>
  38. /// The time at which players will be able to skip the next bounty.
  39. /// </summary>
  40. [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
  41. public TimeSpan NextSkipTime = TimeSpan.Zero;
  42. /// <summary>
  43. /// The time between skipping bounties.
  44. /// </summary>
  45. [DataField]
  46. public TimeSpan SkipDelay = TimeSpan.FromMinutes(15);
  47. }