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,6 +1,4 @@
using Robust.Shared.GameStates;
using Robust.Shared.Physics.Dynamics;
using Robust.Shared.Physics.Events;
using Robust.Shared.Physics.Events;
namespace Content.Shared.Physics;
@@ -10,24 +8,9 @@ public sealed class SharedPreventCollideSystem : EntitySystem
{
base.Initialize();
SubscribeLocalEvent<PreventCollideComponent, ComponentGetState>(OnGetState);
SubscribeLocalEvent<PreventCollideComponent, ComponentHandleState>(OnHandleState);
SubscribeLocalEvent<PreventCollideComponent, PreventCollideEvent>(OnPreventCollide);
}
private void OnGetState(EntityUid uid, PreventCollideComponent component, ref ComponentGetState args)
{
args.State = new PreventCollideComponentState(GetNetEntity(component.Uid));
}
private void OnHandleState(EntityUid uid, PreventCollideComponent component, ref ComponentHandleState args)
{
if (args.Current is not PreventCollideComponentState state)
return;
component.Uid = EnsureEntity<PreventCollideComponent>(state.Uid, uid);
}
private void OnPreventCollide(EntityUid uid, PreventCollideComponent component, ref PreventCollideEvent args)
{
if (component.Uid == args.OtherEntity)