Update trivial components to use auto comp states (#20539)
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
using Content.Shared.Teleportation.Components;
|
||||
using Robust.Shared.GameStates;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using Content.Shared.Teleportation.Components;
|
||||
|
||||
namespace Content.Shared.Teleportation.Systems;
|
||||
|
||||
@@ -20,22 +19,6 @@ public sealed class LinkedEntitySystem : EntitySystem
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<LinkedEntityComponent, ComponentShutdown>(OnLinkShutdown);
|
||||
|
||||
SubscribeLocalEvent<LinkedEntityComponent, ComponentGetState>(OnGetState);
|
||||
SubscribeLocalEvent<LinkedEntityComponent, ComponentHandleState>(OnHandleState);
|
||||
}
|
||||
|
||||
private void OnGetState(EntityUid uid, LinkedEntityComponent component, ref ComponentGetState args)
|
||||
{
|
||||
args.State = new LinkedEntityComponentState(GetNetEntitySet(component.LinkedEntities));
|
||||
}
|
||||
|
||||
private void OnHandleState(EntityUid uid, LinkedEntityComponent component, ref ComponentHandleState args)
|
||||
{
|
||||
if (args.Current is LinkedEntityComponentState state)
|
||||
{
|
||||
component.LinkedEntities = EnsureEntitySet<LinkedEntityComponent>(state.LinkedEntities, uid);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnLinkShutdown(EntityUid uid, LinkedEntityComponent component, ComponentShutdown args)
|
||||
|
||||
Reference in New Issue
Block a user