2021-07-31 03:14:00 +02:00
|
|
|
|
using JetBrains.Annotations;
|
|
|
|
|
|
using Robust.Shared.Map;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Content.Shared.Interaction
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Raised directed on the used object when clicking on another object before an interaction is handled.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[PublicAPI]
|
2022-02-16 00:23:23 -07:00
|
|
|
|
public sealed class BeforeRangedInteractEvent : HandledEntityEventArgs
|
2021-07-31 03:14:00 +02:00
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Entity that triggered the interaction.
|
|
|
|
|
|
/// </summary>
|
2021-12-04 12:35:33 +01:00
|
|
|
|
public EntityUid User { get; }
|
2021-07-31 03:14:00 +02:00
|
|
|
|
|
2021-11-09 15:00:59 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Entity that the user used to interact.
|
|
|
|
|
|
/// </summary>
|
2021-12-04 12:35:33 +01:00
|
|
|
|
public EntityUid Used { get; }
|
2021-07-31 03:14:00 +02:00
|
|
|
|
|
2021-11-09 15:00:59 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Entity that was interacted on. This can be null if the attack did not click on an entity.
|
|
|
|
|
|
/// </summary>
|
2021-12-04 12:35:33 +01:00
|
|
|
|
public EntityUid? Target { get; }
|
2021-11-09 15:00:59 +01:00
|
|
|
|
|
2021-07-31 03:14:00 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Location that the user clicked outside of their interaction range.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public EntityCoordinates ClickLocation { get; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2022-02-05 15:39:01 +13:00
|
|
|
|
/// Is the click location in range and unobstructed?
|
2021-07-31 03:14:00 +02:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool CanReach { get; }
|
|
|
|
|
|
|
2022-02-15 17:06:52 +13:00
|
|
|
|
public BeforeRangedInteractEvent(
|
2021-12-04 12:35:33 +01:00
|
|
|
|
EntityUid user,
|
|
|
|
|
|
EntityUid used,
|
|
|
|
|
|
EntityUid? target,
|
2021-07-31 03:14:00 +02:00
|
|
|
|
EntityCoordinates clickLocation,
|
|
|
|
|
|
bool canReach)
|
|
|
|
|
|
{
|
|
|
|
|
|
User = user;
|
|
|
|
|
|
Used = used;
|
|
|
|
|
|
Target = target;
|
|
|
|
|
|
ClickLocation = clickLocation;
|
|
|
|
|
|
CanReach = canReach;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|