using System.Diagnostics.CodeAnalysis; using Content.Client.Storage.Components; using Content.Shared.Destructible; using Content.Shared.Foldable; using Content.Shared.Interaction; using Content.Shared.Lock; using Content.Shared.Movement.Events; using Content.Shared.Storage.Components; using Content.Shared.Storage.EntitySystems; using Content.Shared.Verbs; using Robust.Shared.GameStates; namespace Content.Client.Storage.Systems; public sealed class EntityStorageSystem : SharedEntityStorageSystem { public override void Initialize() { base.Initialize(); SubscribeLocalEvent(OnEntityUnpausedEvent); SubscribeLocalEvent(OnComponentInit); SubscribeLocalEvent(OnComponentStartup); SubscribeLocalEvent(OnInteract, after: new[] { typeof(LockSystem) }); SubscribeLocalEvent(OnLockToggleAttempt); SubscribeLocalEvent(OnDestruction); SubscribeLocalEvent>(AddToggleOpenVerb); SubscribeLocalEvent(OnRelayMovement); SubscribeLocalEvent(OnFoldAttempt); SubscribeLocalEvent(OnGetState); SubscribeLocalEvent(OnHandleState); } public override bool ResolveStorage(EntityUid uid, [NotNullWhen(true)] ref EntityStorageComponent? component) { if (component != null) return true; TryComp(uid, out var storage); component = storage; return component != null; } }