Files
crystall-punk-14/Content.Shared/Interaction/BeforeInteract.cs

52 lines
1.5 KiB
C#
Raw Permalink Normal View History

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]
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
/// <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
/// <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-07-31 03:14:00 +02:00
/// <summary>
/// Location that the user clicked outside of their interaction range.
/// </summary>
public EntityCoordinates ClickLocation { get; }
/// <summary>
/// Is the click location in range and unobstructed?
2021-07-31 03:14:00 +02:00
/// </summary>
public bool CanReach { get; }
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;
}
}
}