2021-06-09 22:19:39 +02:00
|
|
|
|
using Content.Shared.Interaction;
|
2020-10-28 22:51:43 +00:00
|
|
|
|
using Robust.Shared.GameObjects;
|
2021-12-03 11:30:03 +01:00
|
|
|
|
using Robust.Shared.IoC;
|
2020-10-28 22:51:43 +00:00
|
|
|
|
using Robust.Shared.ViewVariables;
|
|
|
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
|
namespace Content.Server.Morgue.Components
|
2020-10-28 22:51:43 +00:00
|
|
|
|
{
|
|
|
|
|
|
[RegisterComponent]
|
|
|
|
|
|
[ComponentReference(typeof(IActivate))]
|
2022-02-16 00:23:23 -07:00
|
|
|
|
public sealed class MorgueTrayComponent : Component, IActivate
|
2020-10-28 22:51:43 +00:00
|
|
|
|
{
|
|
|
|
|
|
[ViewVariables]
|
2021-12-05 18:09:01 +01:00
|
|
|
|
public EntityUid Morgue { get; set; }
|
2020-10-28 22:51:43 +00:00
|
|
|
|
|
|
|
|
|
|
void IActivate.Activate(ActivateEventArgs eventArgs)
|
|
|
|
|
|
{
|
2021-12-09 12:29:27 +01:00
|
|
|
|
var entMan = IoCManager.Resolve<IEntityManager>();
|
|
|
|
|
|
|
|
|
|
|
|
if (Morgue != default && !entMan.Deleted(Morgue) && entMan.TryGetComponent<MorgueEntityStorageComponent?>(Morgue, out var comp))
|
2020-10-28 22:51:43 +00:00
|
|
|
|
{
|
2021-03-15 21:55:49 +01:00
|
|
|
|
comp.Activate(new ActivateEventArgs(eventArgs.User, Morgue));
|
2020-10-28 22:51:43 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|