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 IEntity User { get; }
///
/// Entity that the user used to interact.
///
public IEntity Used { get; }
///
/// Entity that was interacted on.
///
public IEntity Target { get; }
///
/// Location that the user clicked outside of their interaction range.
///
public EntityCoordinates ClickLocation { get; }
public RangedInteractEvent(IEntity user, IEntity used, IEntity target, EntityCoordinates clickLocation)
{
User = user;
Used = used;
Target = target;
ClickLocation = clickLocation;
}
}
}