2021-06-09 22:19:39 +02:00
|
|
|
|
using Content.Shared.Interaction;
|
2020-10-28 22:51:43 +00:00
|
|
|
|
using Robust.Shared.GameObjects;
|
|
|
|
|
|
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))]
|
|
|
|
|
|
public class MorgueTrayComponent : Component, IActivate
|
|
|
|
|
|
{
|
|
|
|
|
|
public override string Name => "MorgueTray";
|
|
|
|
|
|
|
|
|
|
|
|
[ViewVariables]
|
2021-03-16 15:50:20 +01:00
|
|
|
|
public IEntity? Morgue { get; set; }
|
2020-10-28 22:51:43 +00:00
|
|
|
|
|
|
|
|
|
|
void IActivate.Activate(ActivateEventArgs eventArgs)
|
|
|
|
|
|
{
|
2021-03-15 21:55:49 +01:00
|
|
|
|
if (Morgue != null && !Morgue.Deleted && Morgue.TryGetComponent<MorgueEntityStorageComponent>(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
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|