using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Map; namespace Content.Shared.Weapons.Melee { /// /// Raised directed on the used entity when a target entity is click attacked by a user. /// public class ClickAttackEvent : HandledEntityEventArgs { /// /// Entity used to attack, for broadcast purposes. /// public IEntity Used { get; } /// /// Entity that triggered the attack. /// public IEntity User { get; } /// /// The original location that was clicked by the user. /// public EntityCoordinates ClickLocation { get; } /// /// UID of the entity that was attacked. /// public EntityUid Target { get; } /// /// Entity that was attacked. /// public IEntity? TargetEntity { get; } public ClickAttackEvent(IEntity used, IEntity user, EntityCoordinates clickLocation, EntityUid target = default) { Used = used; User = user; ClickLocation = clickLocation; Target = target; IoCManager.Resolve().TryGetEntity(Target, out var targetEntity); TargetEntity = targetEntity; } } /// /// Raised directed on the used entity when a target entity is wide attacked by a user. /// public class WideAttackEvent : HandledEntityEventArgs { /// /// Entity used to attack, for broadcast purposes. /// public IEntity Used { get; } /// /// Entity that triggered the attack. /// public IEntity User { get; } /// /// The original location that was clicked by the user. /// public EntityCoordinates ClickLocation { get; } public WideAttackEvent(IEntity used, IEntity user, EntityCoordinates clickLocation) { Used = used; User = user; ClickLocation = clickLocation; } } }