1
0

BeforeInteract.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using JetBrains.Annotations;
  2. using Robust.Shared.Map;
  3. namespace Content.Shared.Interaction
  4. {
  5. /// <summary>
  6. /// Raised directed on the used object when clicking on another object before an interaction is handled.
  7. /// </summary>
  8. [PublicAPI]
  9. public sealed class BeforeRangedInteractEvent : HandledEntityEventArgs
  10. {
  11. /// <summary>
  12. /// Entity that triggered the interaction.
  13. /// </summary>
  14. public EntityUid User { get; }
  15. /// <summary>
  16. /// Entity that the user used to interact.
  17. /// </summary>
  18. public EntityUid Used { get; }
  19. /// <summary>
  20. /// Entity that was interacted on. This can be null if the attack did not click on an entity.
  21. /// </summary>
  22. public EntityUid? Target { get; }
  23. /// <summary>
  24. /// Location that the user clicked outside of their interaction range.
  25. /// </summary>
  26. public EntityCoordinates ClickLocation { get; }
  27. /// <summary>
  28. /// Is the click location in range and unobstructed?
  29. /// </summary>
  30. public bool CanReach { get; }
  31. public BeforeRangedInteractEvent(
  32. EntityUid user,
  33. EntityUid used,
  34. EntityUid? target,
  35. EntityCoordinates clickLocation,
  36. bool canReach)
  37. {
  38. User = user;
  39. Used = used;
  40. Target = target;
  41. ClickLocation = clickLocation;
  42. CanReach = canReach;
  43. }
  44. }
  45. }