Update trivial components to use auto comp states (#20539)

This commit is contained in:
DrSmugleaf
2023-09-28 16:20:29 -07:00
committed by GitHub
parent 14cfe44ece
commit a44fa86b68
158 changed files with 806 additions and 2866 deletions

View File

@@ -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)