LinkedEntityComponent.cs 1001 B

1234567891011121314151617181920212223242526272829303132
  1. using Content.Shared.Teleportation.Systems;
  2. using Robust.Shared.GameStates;
  3. using Robust.Shared.Serialization;
  4. namespace Content.Shared.Teleportation.Components;
  5. /// <summary>
  6. /// Represents an entity which is linked to other entities (perhaps portals), and which can be walked through /
  7. /// thrown into to teleport an entity.
  8. /// </summary>
  9. [RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
  10. [Access(typeof(LinkedEntitySystem))]
  11. public sealed partial class LinkedEntityComponent : Component
  12. {
  13. /// <summary>
  14. /// The entities that this entity is linked to.
  15. /// </summary>
  16. [DataField, AutoNetworkedField]
  17. public HashSet<EntityUid> LinkedEntities = new();
  18. /// <summary>
  19. /// Should this entity be deleted if all of its links are removed?
  20. /// </summary>
  21. [DataField, ViewVariables(VVAccess.ReadWrite)]
  22. public bool DeleteOnEmptyLinks;
  23. }
  24. [Serializable, NetSerializable]
  25. public enum LinkedEntityVisuals : byte
  26. {
  27. HasAnyLinks
  28. }