using System;
using JetBrains.Annotations;
using Robust.Shared.Analyzers;
using Robust.Shared.GameObjects;
using Robust.Shared.Map;
namespace Content.Shared.Interaction
{
///
/// This interface gives components behavior when being clicked on by a user with an object
/// outside the range of direct use
///
[RequiresExplicitImplementation]
public interface IRangedInteract
{
///
/// Called when we try to interact with an entity out of range
///
[Obsolete("Use RangedInteractMessage instead")]
bool RangedInteract(RangedInteractEventArgs eventArgs);
}
[PublicAPI]
public class RangedInteractEventArgs : EventArgs
{
public RangedInteractEventArgs(IEntity user, IEntity @using, EntityCoordinates clickLocation)
{
User = user;
Using = @using;
ClickLocation = clickLocation;
}
public IEntity User { get; }
public IEntity Using { get; }
public EntityCoordinates ClickLocation { get; }
}
///
/// Raised when an entity is interacted with that is out of the user entity's range of direct use.
///
[PublicAPI]
public class RangedInteractEvent : HandledEntityEventArgs
{
///
/// Entity that triggered the interaction.
///
public EntityUid UserUid { get; }
///
/// Entity that the user used to interact.
///
public EntityUid UsedUid { get; }
///
/// Entity that was interacted on.
///
public EntityUid TargetUid { get; }
///
/// Location that the user clicked outside of their interaction range.
///
public EntityCoordinates ClickLocation { get; }
public RangedInteractEvent(EntityUid user, EntityUid used, EntityUid target, EntityCoordinates clickLocation)
{
UserUid = user;
UsedUid = used;
TargetUid = target;
ClickLocation = clickLocation;
}
}
}