Update trivial components to use auto comp states (#20539)
This commit is contained in:
@@ -8,31 +8,21 @@ namespace Content.Shared.Teleportation.Components;
|
||||
/// Represents an entity which is linked to other entities (perhaps portals), and which can be walked through/
|
||||
/// thrown into to teleport an entity.
|
||||
/// </summary>
|
||||
[RegisterComponent, Access(typeof(LinkedEntitySystem)), NetworkedComponent]
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
||||
[Access(typeof(LinkedEntitySystem))]
|
||||
public sealed partial class LinkedEntityComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// The entities that this entity is linked to.
|
||||
/// </summary>
|
||||
[DataField("linkedEntities")]
|
||||
[DataField, AutoNetworkedField]
|
||||
public HashSet<EntityUid> LinkedEntities = new();
|
||||
|
||||
/// <summary>
|
||||
/// Should this entity be deleted if all of its links are removed?
|
||||
/// </summary>
|
||||
[DataField("deleteOnEmptyLinks")]
|
||||
public bool DeleteOnEmptyLinks = false;
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class LinkedEntityComponentState : ComponentState
|
||||
{
|
||||
public HashSet<NetEntity> LinkedEntities;
|
||||
|
||||
public LinkedEntityComponentState(HashSet<NetEntity> linkedEntities)
|
||||
{
|
||||
LinkedEntities = linkedEntities;
|
||||
}
|
||||
[DataField]
|
||||
public bool DeleteOnEmptyLinks;
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
|
||||
Reference in New Issue
Block a user