Files
tbd-station-14/Content.Shared/GameObjects/Components/GUI/SharedStrippingComponent.cs
ShadowCommander acb102f978 Rename and clean up interaction events (#4044)
* Rename and clean up interaction events

* Fix hand equip events
2021-05-22 21:06:40 -07:00

28 lines
822 B
C#

#nullable enable
using Content.Shared.Interfaces.GameObjects.Components;
using Robust.Shared.GameObjects;
namespace Content.Shared.GameObjects.Components.GUI
{
/// <summary>
/// Give to an entity to say they can strip another entity.
/// </summary>
[RegisterComponent]
public class SharedStrippingComponent : Component, IDragDropOn
{
public override string Name => "Stripping";
bool IDragDropOn.CanDragDropOn(DragDropEvent eventArgs)
{
if (!eventArgs.Dragged.TryGetComponent(out SharedStrippableComponent? strippable)) return false;
return strippable.CanBeStripped(Owner);
}
bool IDragDropOn.DragDropOn(DragDropEvent eventArgs)
{
// Handled by StrippableComponent
return true;
}
}
}