RoboticsConsoleComponent.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using Content.Shared.Radio;
  2. using Content.Shared.Robotics;
  3. using Content.Shared.Robotics.Systems;
  4. using Robust.Shared.GameStates;
  5. using Robust.Shared.Prototypes;
  6. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
  7. namespace Content.Shared.Robotics.Components;
  8. /// <summary>
  9. /// Robotics console for managing borgs.
  10. /// </summary>
  11. [RegisterComponent, NetworkedComponent, Access(typeof(SharedRoboticsConsoleSystem))]
  12. [AutoGenerateComponentState, AutoGenerateComponentPause]
  13. public sealed partial class RoboticsConsoleComponent : Component
  14. {
  15. /// <summary>
  16. /// Address and data of each cyborg.
  17. /// </summary>
  18. [DataField]
  19. public Dictionary<string, CyborgControlData> Cyborgs = new();
  20. /// <summary>
  21. /// After not responding for this length of time borgs are removed from the console.
  22. /// </summary>
  23. [DataField]
  24. public TimeSpan Timeout = TimeSpan.FromSeconds(10);
  25. /// <summary>
  26. /// Radio channel to send messages on.
  27. /// </summary>
  28. [DataField]
  29. public ProtoId<RadioChannelPrototype> RadioChannel = "Science";
  30. /// <summary>
  31. /// Radio message sent when destroying a borg.
  32. /// </summary>
  33. [DataField]
  34. public LocId DestroyMessage = "robotics-console-cyborg-destroying";
  35. /// <summary>
  36. /// Cooldown on destroying borgs to prevent complete abuse.
  37. /// </summary>
  38. [DataField]
  39. public TimeSpan DestroyCooldown = TimeSpan.FromSeconds(30);
  40. /// <summary>
  41. /// When a borg can next be destroyed.
  42. /// </summary>
  43. [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
  44. [AutoNetworkedField, AutoPausedField]
  45. public TimeSpan NextDestroy = TimeSpan.Zero;
  46. }