1
0

InteractHand.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using JetBrains.Annotations;
  2. using Robust.Shared.Map;
  3. namespace Content.Shared.Interaction
  4. {
  5. public sealed class InteractHandEventArgs : EventArgs, ITargetedInteractEventArgs
  6. {
  7. public InteractHandEventArgs(EntityUid user, EntityUid target)
  8. {
  9. User = user;
  10. Target = target;
  11. }
  12. public EntityUid User { get; }
  13. public EntityUid Target { get; }
  14. }
  15. /// <summary>
  16. /// Raised directed on a target entity when it is interacted with by a user with an empty hand.
  17. /// </summary>
  18. [PublicAPI]
  19. public sealed class InteractHandEvent : HandledEntityEventArgs, ITargetedInteractEventArgs
  20. {
  21. /// <summary>
  22. /// Entity that triggered the interaction.
  23. /// </summary>
  24. public EntityUid User { get; }
  25. /// <summary>
  26. /// Entity that was interacted on.
  27. /// </summary>
  28. public EntityUid Target { get; }
  29. public InteractHandEvent(EntityUid user, EntityUid target)
  30. {
  31. User = user;
  32. Target = target;
  33. }
  34. }
  35. /// <summary>
  36. /// Raised on the user before interacting on an entity with bare hand.
  37. /// Interaction is cancelled if this event is handled, so set it to true if you do custom interaction logic.
  38. /// </summary>
  39. public sealed class BeforeInteractHandEvent : HandledEntityEventArgs
  40. {
  41. public EntityUid Target { get; }
  42. public BeforeInteractHandEvent(EntityUid target)
  43. {
  44. Target = target;
  45. }
  46. }
  47. }