2020-07-06 14:27:03 -07:00
|
|
|
using JetBrains.Annotations;
|
|
|
|
|
using Robust.Shared.Map;
|
|
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
namespace Content.Shared.Interaction
|
2020-07-06 14:27:03 -07:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
2021-05-22 21:06:40 -07:00
|
|
|
/// Raised when an entity is interacted with that is out of the user entity's range of direct use.
|
2020-07-06 14:27:03 -07:00
|
|
|
/// </summary>
|
|
|
|
|
[PublicAPI]
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class RangedInteractEvent : HandledEntityEventArgs
|
2020-07-06 14:27:03 -07:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
2021-05-22 21:06:40 -07:00
|
|
|
/// Entity that triggered the interaction.
|
2020-07-06 14:27:03 -07:00
|
|
|
/// </summary>
|
2021-11-09 15:05:04 +01:00
|
|
|
public EntityUid UserUid { get; }
|
2020-07-06 14:27:03 -07:00
|
|
|
|
2021-11-09 15:00:59 +01:00
|
|
|
/// <summary>
|
|
|
|
|
/// Entity that the user used to interact.
|
|
|
|
|
/// </summary>
|
2021-11-09 15:05:04 +01:00
|
|
|
public EntityUid UsedUid { get; }
|
2021-11-09 15:00:59 +01:00
|
|
|
|
2020-07-06 14:27:03 -07:00
|
|
|
/// <summary>
|
2021-05-22 21:06:40 -07:00
|
|
|
/// Entity that was interacted on.
|
2020-07-06 14:27:03 -07:00
|
|
|
/// </summary>
|
2021-11-09 15:05:04 +01:00
|
|
|
public EntityUid TargetUid { get; }
|
2021-11-09 15:00:59 +01:00
|
|
|
|
2020-07-06 14:27:03 -07:00
|
|
|
/// <summary>
|
|
|
|
|
/// Location that the user clicked outside of their interaction range.
|
|
|
|
|
/// </summary>
|
2020-09-06 16:11:53 +02:00
|
|
|
public EntityCoordinates ClickLocation { get; }
|
2020-07-06 14:27:03 -07:00
|
|
|
|
2021-11-09 15:05:04 +01:00
|
|
|
public RangedInteractEvent(EntityUid user, EntityUid used, EntityUid target, EntityCoordinates clickLocation)
|
2020-07-06 14:27:03 -07:00
|
|
|
{
|
2021-11-09 15:05:04 +01:00
|
|
|
UserUid = user;
|
|
|
|
|
UsedUid = used;
|
|
|
|
|
TargetUid = target;
|
2020-07-06 14:27:03 -07:00
|
|
|
ClickLocation = clickLocation;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|