1
0

DeviceLinkSinkComponent.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using Robust.Shared.GameStates;
  2. using Robust.Shared.Prototypes;
  3. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Set;
  4. namespace Content.Shared.DeviceLinking;
  5. [RegisterComponent]
  6. [NetworkedComponent] // for interactions. Actual state isn't currently synced.
  7. [Access(typeof(SharedDeviceLinkSystem))]
  8. public sealed partial class DeviceLinkSinkComponent : Component
  9. {
  10. /// <summary>
  11. /// The ports this sink has
  12. /// </summary>
  13. [DataField]
  14. public HashSet<ProtoId<SinkPortPrototype>> Ports = new();
  15. /// <summary>
  16. /// Used for removing a sink from all linked sources when this component gets removed.
  17. /// This is not serialized to yaml as it can be inferred from source components.
  18. /// </summary>
  19. [ViewVariables]
  20. public HashSet<EntityUid> LinkedSources = new();
  21. /// <summary>
  22. /// Counts the amount of times a sink has been invoked for severing the link if this counter gets to high
  23. /// The counter is counted down by one every tick if it's higher than 0
  24. /// This is for preventing infinite loops
  25. /// </summary>
  26. [DataField]
  27. public int InvokeCounter;
  28. /// <summary>
  29. /// How high the invoke counter is allowed to get before the links to the sink are removed and the DeviceLinkOverloadedEvent gets raised
  30. /// If the invoke limit is smaller than 1 the sink can't overload
  31. /// </summary>
  32. [DataField]
  33. public int InvokeLimit = 10;
  34. }