1
0

ActivateInWorldEvent.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. using JetBrains.Annotations;
  2. namespace Content.Shared.Interaction;
  3. /// <summary>
  4. /// Raised when an entity is activated in the world.
  5. /// </summary>
  6. [PublicAPI]
  7. public sealed class ActivateInWorldEvent : HandledEntityEventArgs, ITargetedInteractEventArgs
  8. {
  9. /// <summary>
  10. /// Entity that activated the target world entity.
  11. /// </summary>
  12. public EntityUid User { get; }
  13. /// <summary>
  14. /// Entity that was activated in the world.
  15. /// </summary>
  16. public EntityUid Target { get; }
  17. /// <summary>
  18. /// Whether or not <see cref="User"/> can perform complex interactions or only basic ones.
  19. /// </summary>
  20. public bool Complex;
  21. /// <summary>
  22. /// Set to true when the activation is logged by a specific logger.
  23. /// </summary>
  24. public bool WasLogged { get; set; }
  25. public ActivateInWorldEvent(EntityUid user, EntityUid target, bool complex)
  26. {
  27. User = user;
  28. Target = target;
  29. Complex = complex;
  30. }
  31. }
  32. /// <summary>
  33. /// Event raised on the user when it activates something in the world
  34. /// </summary>
  35. [PublicAPI]
  36. public sealed class UserActivateInWorldEvent : HandledEntityEventArgs, ITargetedInteractEventArgs
  37. {
  38. /// <summary>
  39. /// Entity that activated the target world entity.
  40. /// </summary>
  41. public EntityUid User { get; }
  42. /// <summary>
  43. /// Entity that was activated in the world.
  44. /// </summary>
  45. public EntityUid Target { get; }
  46. /// <summary>
  47. /// Whether or not <see cref="User"/> can perform complex interactions or only basic ones.
  48. /// </summary>
  49. public bool Complex;
  50. public UserActivateInWorldEvent(EntityUid user, EntityUid target, bool complex)
  51. {
  52. User = user;
  53. Target = target;
  54. Complex = complex;
  55. }
  56. }