Implement ECS alternative for IDragDropOn and fully ECS disposal units (#6380)

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
Julian Giebel
2022-01-30 17:53:22 +01:00
committed by GitHub
parent 1bece1c1ba
commit 305cff2659
10 changed files with 147 additions and 128 deletions

View File

@@ -0,0 +1,38 @@
using Robust.Shared.GameObjects;
namespace Content.Shared.DragDrop;
/// <summary>
/// Event that gets send to the target of a drag drop action
/// Mark this event as handled to specify that the entity can be dropped on
/// and set CanDrop to true or false, depending on whether dropping the entity onto the target is actually possible.
/// </summary>
public class CanDragDropOnEvent : HandledEntityEventArgs
{
/// <summary>
/// Entity doing the drag and drop.
/// </summary>
public EntityUid User { get; }
/// <summary>
/// Entity that is being dragged.
/// </summary>
public EntityUid Dragged { get; }
/// <summary>
/// Entity that is being dropped on.
/// </summary>
public EntityUid Target { get; }
/// <summary>
/// If the dragged entity can be dropped on the target.
/// </summary>
public bool CanDrop { get; set; } = false;
public CanDragDropOnEvent(EntityUid user, EntityUid dragged, EntityUid target)
{
User = user;
Dragged = dragged;
Target = target;
}
}