ActiveRadioComponent.cs 990 B

123456789101112131415161718192021222324252627282930
  1. using Content.Shared.Radio;
  2. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Set;
  3. namespace Content.Server.Radio.Components;
  4. /// <summary>
  5. /// This component is required to receive radio message events.
  6. /// </summary>
  7. [RegisterComponent]
  8. public sealed partial class ActiveRadioComponent : Component
  9. {
  10. /// <summary>
  11. /// The channels that this radio is listening on.
  12. /// </summary>
  13. [DataField("channels", customTypeSerializer: typeof(PrototypeIdHashSetSerializer<RadioChannelPrototype>))]
  14. public HashSet<string> Channels = new();
  15. /// <summary>
  16. /// A toggle for globally receiving all radio channels.
  17. /// Overrides <see cref="Channels"/>
  18. /// </summary>
  19. [DataField, ViewVariables(VVAccess.ReadWrite)]
  20. public bool ReceiveAllChannels;
  21. /// <summary>
  22. /// If this radio can hear all messages on all maps
  23. /// </summary>
  24. [DataField("globalReceive")]
  25. public bool GlobalReceive = false;
  26. }