Files
crystall-punk-14/Content.Shared/Strip/Components/SharedStrippingComponent.cs

26 lines
787 B
C#
Raw Normal View History

2021-06-09 22:19:39 +02:00
using Content.Shared.DragDrop;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
2021-06-09 22:19:39 +02:00
namespace Content.Shared.Strip.Components
{
/// <summary>
/// Give to an entity to say they can strip another entity.
/// </summary>
[RegisterComponent]
public sealed class SharedStrippingComponent : Component, IDragDropOn
{
bool IDragDropOn.CanDragDropOn(DragDropEvent eventArgs)
{
2021-12-03 15:53:09 +01:00
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(eventArgs.Dragged, out SharedStrippableComponent? strippable)) return false;
return strippable.CanBeStripped(Owner);
}
bool IDragDropOn.DragDropOn(DragDropEvent eventArgs)
{
// Handled by StrippableComponent
return true;
}
}
}