Re-organize all projects (#4166)
This commit is contained in:
27
Content.Shared/Strip/Components/SharedStrippingComponent.cs
Normal file
27
Content.Shared/Strip/Components/SharedStrippingComponent.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
#nullable enable
|
||||
using Content.Shared.DragDrop;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Content.Shared.Strip.Components
|
||||
{
|
||||
/// <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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user