2021-01-24 19:00:58 +11:00
|
|
|
#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";
|
|
|
|
|
|
2021-02-08 22:46:28 +01:00
|
|
|
bool IDragDropOn.CanDragDropOn(DragDropEventArgs eventArgs)
|
2021-01-24 19:00:58 +11:00
|
|
|
{
|
|
|
|
|
if (!eventArgs.Dragged.TryGetComponent(out SharedStrippableComponent? strippable)) return false;
|
|
|
|
|
return strippable.CanBeStripped(Owner);
|
|
|
|
|
}
|
|
|
|
|
|
2021-02-08 22:46:28 +01:00
|
|
|
bool IDragDropOn.DragDropOn(DragDropEventArgs eventArgs)
|
2021-01-24 19:00:58 +11:00
|
|
|
{
|
|
|
|
|
// Handled by StrippableComponent
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|