WiresPanelSecurityComponent.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using Robust.Shared.GameStates;
  2. namespace Content.Shared.Wires;
  3. /// <summary>
  4. /// Allows hacking protections to a be added to an entity.
  5. /// These safeguards are determined via a construction graph,
  6. /// so the entity requires <cref="ConstructionComponent"/> for this to function
  7. /// </summary>
  8. [NetworkedComponent, RegisterComponent]
  9. [Access(typeof(SharedWiresSystem))]
  10. [AutoGenerateComponentState]
  11. public sealed partial class WiresPanelSecurityComponent : Component
  12. {
  13. /// <summary>
  14. /// A verbal description of the wire panel's current security level
  15. /// </summary>
  16. [DataField("examine")]
  17. [AutoNetworkedField]
  18. public string? Examine = default!;
  19. /// <summary>
  20. /// Determines whether the wiring is accessible to hackers or not
  21. /// </summary>
  22. [DataField("wiresAccessible")]
  23. [AutoNetworkedField]
  24. public bool WiresAccessible = true;
  25. /// <summary>
  26. /// Name of the construction graph node that the entity will start on
  27. /// </summary>
  28. [DataField("securityLevel")]
  29. [AutoNetworkedField]
  30. public string SecurityLevel = string.Empty;
  31. }
  32. /// <summary>
  33. /// This event gets raised when security settings on a wires panel change
  34. /// </summary>
  35. public sealed class WiresPanelSecurityEvent : EntityEventArgs
  36. {
  37. public readonly string? Examine;
  38. public readonly bool WiresAccessible;
  39. public WiresPanelSecurityEvent(string? examine, bool wiresAccessible)
  40. {
  41. Examine = examine;
  42. WiresAccessible = wiresAccessible;
  43. }
  44. }