ThrowEvents.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. namespace Content.Shared.Throwing
  2. {
  3. /// <summary>
  4. /// Base class for all throw events.
  5. /// </summary>
  6. public abstract class ThrowEvent : HandledEntityEventArgs
  7. {
  8. public readonly EntityUid Thrown;
  9. public readonly EntityUid Target;
  10. public ThrownItemComponent Component;
  11. public ThrowEvent(EntityUid thrown, EntityUid target, ThrownItemComponent component)
  12. {
  13. Thrown = thrown;
  14. Target = target;
  15. Component = component;
  16. }
  17. }
  18. /// <summary>
  19. /// Raised directed on the target entity being hit by the thrown entity.
  20. /// </summary>
  21. public sealed class ThrowHitByEvent : ThrowEvent
  22. {
  23. public ThrowHitByEvent(EntityUid thrown, EntityUid target, ThrownItemComponent component) : base(thrown, target, component)
  24. {
  25. }
  26. }
  27. /// <summary>
  28. /// Raised directed on the thrown entity that hits another.
  29. /// </summary>
  30. public sealed class ThrowDoHitEvent : ThrowEvent
  31. {
  32. public ThrowDoHitEvent(EntityUid thrown, EntityUid target, ThrownItemComponent component) : base(thrown, target, component)
  33. {
  34. }
  35. }
  36. }