2023-01-02 19:58:25 -06:00
|
|
|
|
using Content.Shared.Teleportation.Systems;
|
|
|
|
|
|
using Robust.Shared.GameStates;
|
|
|
|
|
|
using Robust.Shared.Serialization;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Content.Shared.Teleportation.Components;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2023-11-15 13:23:40 +11:00
|
|
|
|
/// Represents an entity which is linked to other entities (perhaps portals), and which can be walked through /
|
2023-01-02 19:58:25 -06:00
|
|
|
|
/// thrown into to teleport an entity.
|
|
|
|
|
|
/// </summary>
|
2023-09-28 16:20:29 -07:00
|
|
|
|
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
|
|
|
|
|
[Access(typeof(LinkedEntitySystem))]
|
2023-08-22 18:14:33 -07:00
|
|
|
|
public sealed partial class LinkedEntityComponent : Component
|
2023-01-02 19:58:25 -06:00
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The entities that this entity is linked to.
|
|
|
|
|
|
/// </summary>
|
2023-09-28 16:20:29 -07:00
|
|
|
|
[DataField, AutoNetworkedField]
|
2023-01-02 19:58:25 -06:00
|
|
|
|
public HashSet<EntityUid> LinkedEntities = new();
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Should this entity be deleted if all of its links are removed?
|
|
|
|
|
|
/// </summary>
|
2023-11-19 15:17:53 -05:00
|
|
|
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
2023-09-28 16:20:29 -07:00
|
|
|
|
public bool DeleteOnEmptyLinks;
|
2023-01-02 19:58:25 -06:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Serializable, NetSerializable]
|
|
|
|
|
|
public enum LinkedEntityVisuals : byte
|
|
|
|
|
|
{
|
|
|
|
|
|
HasAnyLinks
|
|
|
|
|
|
}
|