WiresComponent.cs 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. using Robust.Shared.Audio;
  2. using Robust.Shared.Prototypes;
  3. namespace Content.Server.Wires;
  4. [RegisterComponent]
  5. public sealed partial class WiresComponent : Component
  6. {
  7. /// <summary>
  8. /// The name of this entity's internal board.
  9. /// </summary>
  10. [DataField]
  11. public LocId BoardName { get; set; } = "wires-board-name-default";
  12. /// <summary>
  13. /// The layout ID of this entity's wires.
  14. /// </summary>
  15. [DataField(required: true)]
  16. public ProtoId<WireLayoutPrototype> LayoutId { get; set; } = default!;
  17. /// <summary>
  18. /// The serial number of this board. Randomly generated upon start,
  19. /// does not need to be set.
  20. /// </summary>
  21. [ViewVariables]
  22. public string? SerialNumber { get; set; }
  23. /// <summary>
  24. /// The seed that dictates the wires appearance, as well as
  25. /// the status ordering on the UI client side.
  26. /// </summary>
  27. [ViewVariables]
  28. public int WireSeed { get; set; }
  29. /// <summary>
  30. /// The list of wires currently active on this entity.
  31. /// </summary>
  32. [ViewVariables]
  33. public List<Wire> WiresList { get; set; } = new();
  34. /// <summary>
  35. /// Queue of wires saved while the wire's DoAfter event occurs, to prevent too much spam.
  36. /// </summary>
  37. [ViewVariables]
  38. public List<int> WiresQueue { get; } = new();
  39. /// <summary>
  40. /// If this should follow the layout saved the first time the layout dictated by the
  41. /// layout ID is generated, or if a new wire order should be generated every time.
  42. /// </summary>
  43. [DataField]
  44. public bool AlwaysRandomize { get; private set; }
  45. /// <summary>
  46. /// Per wire status, keyed by an object.
  47. /// </summary>
  48. [ViewVariables]
  49. public Dictionary<object, object> Statuses { get; } = new();
  50. /// <summary>
  51. /// The state data for the set of wires inside of this entity.
  52. /// This is so that wire objects can be flyweighted between
  53. /// entities without any issues.
  54. /// </summary>
  55. [ViewVariables]
  56. public Dictionary<object, object> StateData { get; } = new();
  57. [DataField]
  58. public SoundSpecifier PulseSound = new SoundPathSpecifier("/Audio/Effects/multitool_pulse.ogg");
  59. }