using JetBrains.Annotations;
using Robust.Shared.Map;
using Robust.Shared.Utility;
namespace Content.Shared.Interaction
{
///
/// Raised when a target entity is interacted with by a user while holding an object in their hand.
///
[PublicAPI]
public sealed class InteractUsingEvent : HandledEntityEventArgs
{
///
/// Entity that triggered the interaction.
///
public EntityUid User { get; }
///
/// Entity that the user used to interact.
///
public EntityUid Used { get; }
///
/// Entity that was interacted on.
///
public EntityUid Target { get; }
///
/// The original location that was clicked by the user.
///
public EntityCoordinates ClickLocation { get; }
public InteractUsingEvent(EntityUid user, EntityUid used, EntityUid target, EntityCoordinates clickLocation)
{
// Interact using should not have the same used and target.
// That should be a use-in-hand event instead.
// If this is not the case, can lead to bugs (e.g., attempting to merge a item stack into itself).
DebugTools.Assert(used != target);
User = user;
Used = used;
Target = target;
ClickLocation = clickLocation;
}
}
}