Files
tbd-station-14/Content.Shared/DragDrop/IDragDropOn.cs
2022-05-13 17:59:03 +10:00

33 lines
1.3 KiB
C#

namespace Content.Shared.DragDrop
{
/// <summary>
/// This interface allows the component's entity to be dragged and dropped
/// onto by another entity and gives it behavior when that occurs.
/// </summary>
[RequiresExplicitImplementation]
public interface IDragDropOn
{
/// <summary>
/// Invoked when another entity is being dragged and dropped
/// onto this one before invoking <see cref="DragDropOn"/>.
/// Note that other drag and drop interactions may be attempted if
/// this one fails.
/// </summary>
/// <param name="eventArgs"></param>
/// <returns>true if <see cref="eventArgs"/> is valid, false otherwise.</returns>
bool CanDragDropOn(DragDropEvent eventArgs);
/// <summary>
/// Invoked server-side when another entity is being dragged and dropped
/// onto this one before invoking <see cref="DragDropOn"/>
/// Note that other drag and drop interactions may be attempted if
/// this one fails.
/// </summary>
/// <returns>
/// true if an interaction occurred and no further interaction should
/// be processed for this drop.
/// </returns>
bool DragDropOn(DragDropEvent eventArgs);
}
}