diff --git a/Content.Client/GameObjects/Components/Body/BodyComponent.cs b/Content.Client/GameObjects/Components/Body/BodyComponent.cs index 0687f213b1..9e60d8262e 100644 --- a/Content.Client/GameObjects/Components/Body/BodyComponent.cs +++ b/Content.Client/GameObjects/Components/Body/BodyComponent.cs @@ -8,12 +8,12 @@ namespace Content.Client.GameObjects.Components.Body [ComponentReference(typeof(IBody))] public class BodyComponent : SharedBodyComponent, IDraggable { - bool IDraggable.CanStartDrag(StartDragDropEventArgs args) + bool IDraggable.CanStartDrag(StartDragDropEvent args) { return true; } - bool IDraggable.CanDrop(CanDropEventArgs args) + bool IDraggable.CanDrop(CanDropEvent args) { return true; } diff --git a/Content.Client/GameObjects/Components/Disposal/DisposalMailingUnitComponent.cs b/Content.Client/GameObjects/Components/Disposal/DisposalMailingUnitComponent.cs index f3a7376cc3..ec798a9834 100644 --- a/Content.Client/GameObjects/Components/Disposal/DisposalMailingUnitComponent.cs +++ b/Content.Client/GameObjects/Components/Disposal/DisposalMailingUnitComponent.cs @@ -8,7 +8,7 @@ namespace Content.Client.GameObjects.Components.Disposal [ComponentReference(typeof(SharedDisposalMailingUnitComponent))] public class DisposalMailingUnitComponent : SharedDisposalMailingUnitComponent { - public override bool DragDropOn(DragDropEventArgs eventArgs) + public override bool DragDropOn(DragDropEvent eventArgs) { return false; } diff --git a/Content.Client/GameObjects/Components/Disposal/DisposalUnitComponent.cs b/Content.Client/GameObjects/Components/Disposal/DisposalUnitComponent.cs index 5451edc71d..0db42a7ff1 100644 --- a/Content.Client/GameObjects/Components/Disposal/DisposalUnitComponent.cs +++ b/Content.Client/GameObjects/Components/Disposal/DisposalUnitComponent.cs @@ -8,7 +8,7 @@ namespace Content.Client.GameObjects.Components.Disposal [ComponentReference(typeof(SharedDisposalUnitComponent))] public class DisposalUnitComponent : SharedDisposalUnitComponent { - public override bool DragDropOn(DragDropEventArgs eventArgs) + public override bool DragDropOn(DragDropEvent eventArgs) { return false; } diff --git a/Content.Client/GameObjects/Components/GUI/StrippableComponent.cs b/Content.Client/GameObjects/Components/GUI/StrippableComponent.cs index 05fc41976f..010b24c796 100644 --- a/Content.Client/GameObjects/Components/GUI/StrippableComponent.cs +++ b/Content.Client/GameObjects/Components/GUI/StrippableComponent.cs @@ -8,7 +8,7 @@ namespace Content.Client.GameObjects.Components.GUI [ComponentReference(typeof(SharedStrippableComponent))] public class StrippableComponent : SharedStrippableComponent { - public override bool Drop(DragDropEventArgs args) + public override bool Drop(DragDropEvent args) { // TODO: Prediction return false; diff --git a/Content.Client/GameObjects/Components/Kitchen/KitchenSpikeComponent.cs b/Content.Client/GameObjects/Components/Kitchen/KitchenSpikeComponent.cs index 37c7822493..fa838358ac 100644 --- a/Content.Client/GameObjects/Components/Kitchen/KitchenSpikeComponent.cs +++ b/Content.Client/GameObjects/Components/Kitchen/KitchenSpikeComponent.cs @@ -8,7 +8,7 @@ namespace Content.Client.GameObjects.Components.Kitchen [RegisterComponent] internal sealed class KitchenSpikeComponent : SharedKitchenSpikeComponent { - public override bool DragDropOn(DragDropEventArgs eventArgs) + public override bool DragDropOn(DragDropEvent eventArgs) { return true; } diff --git a/Content.Client/GameObjects/Components/MedicalScanner/MedicalScannerComponent.cs b/Content.Client/GameObjects/Components/MedicalScanner/MedicalScannerComponent.cs index 6ba483832a..1063a37cdf 100644 --- a/Content.Client/GameObjects/Components/MedicalScanner/MedicalScannerComponent.cs +++ b/Content.Client/GameObjects/Components/MedicalScanner/MedicalScannerComponent.cs @@ -8,7 +8,7 @@ namespace Content.Client.GameObjects.Components.MedicalScanner [ComponentReference(typeof(SharedMedicalScannerComponent))] public class MedicalScannerComponent : SharedMedicalScannerComponent { - public override bool DragDropOn(DragDropEventArgs eventArgs) + public override bool DragDropOn(DragDropEvent eventArgs) { return false; } diff --git a/Content.Client/GameObjects/Components/Movement/ClimbableComponent.cs b/Content.Client/GameObjects/Components/Movement/ClimbableComponent.cs index 9b00b30bae..9cd08c1a52 100644 --- a/Content.Client/GameObjects/Components/Movement/ClimbableComponent.cs +++ b/Content.Client/GameObjects/Components/Movement/ClimbableComponent.cs @@ -9,7 +9,7 @@ namespace Content.Client.GameObjects.Components.Movement [ComponentReference(typeof(IClimbable))] public class ClimbableComponent : SharedClimbableComponent { - public override bool CanDragDropOn(DragDropEventArgs eventArgs) + public override bool CanDragDropOn(DragDropEvent eventArgs) { if (!base.CanDragDropOn(eventArgs)) return false; @@ -22,7 +22,7 @@ namespace Content.Client.GameObjects.Components.Movement return user.InRangeUnobstructed(target, Range, predicate: Ignored) && user.InRangeUnobstructed(dragged, Range, predicate: Ignored); } - public override bool DragDropOn(DragDropEventArgs eventArgs) + public override bool DragDropOn(DragDropEvent eventArgs) { return false; } diff --git a/Content.Client/GameObjects/Components/Strap/StrapComponent.cs b/Content.Client/GameObjects/Components/Strap/StrapComponent.cs index e4daca1fef..6e25fa61fe 100644 --- a/Content.Client/GameObjects/Components/Strap/StrapComponent.cs +++ b/Content.Client/GameObjects/Components/Strap/StrapComponent.cs @@ -8,7 +8,7 @@ namespace Content.Client.GameObjects.Components.Strap [ComponentReference(typeof(SharedStrapComponent))] public class StrapComponent : SharedStrapComponent { - public override bool DragDropOn(DragDropEventArgs eventArgs) + public override bool DragDropOn(DragDropEvent eventArgs) { return false; } diff --git a/Content.Client/GameObjects/EntitySystems/DragDropSystem.cs b/Content.Client/GameObjects/EntitySystems/DragDropSystem.cs index e58366c41c..51466146d3 100644 --- a/Content.Client/GameObjects/EntitySystems/DragDropSystem.cs +++ b/Content.Client/GameObjects/EntitySystems/DragDropSystem.cs @@ -145,7 +145,7 @@ namespace Content.Client.GameObjects.EntitySystems var canDrag = false; foreach (var draggable in entity.GetAllComponents()) { - var dragEventArgs = new StartDragDropEventArgs(dragger, entity); + var dragEventArgs = new StartDragDropEvent(dragger, entity); if (!draggable.CanStartDrag(dragEventArgs)) { @@ -315,7 +315,7 @@ namespace Content.Client.GameObjects.EntitySystems if (entity == _dragDropHelper.Dragged) continue; // check if it's able to be dropped on by current dragged entity - var dropArgs = new DragDropEventArgs(_dragger, args.Coordinates, _dragDropHelper.Dragged, entity); + var dropArgs = new DragDropEvent(_dragger, args.Coordinates, _dragDropHelper.Dragged, entity); // TODO: Cache valid CanDragDrops if (ValidDragDrop(dropArgs) != true) continue; @@ -331,7 +331,7 @@ namespace Content.Client.GameObjects.EntitySystems if (!draggable.CanDrop(dropArgs)) continue; // tell the server about the drop attempt - RaiseNetworkEvent(new DragDropMessage(args.Coordinates, _dragDropHelper.Dragged!.Uid, + RaiseNetworkEvent(new DragDropRequestEvent(args.Coordinates, _dragDropHelper.Dragged!.Uid, entity.Uid)); draggable.Drop(dropArgs); @@ -380,7 +380,7 @@ namespace Content.Client.GameObjects.EntitySystems pvsEntity == _dragDropHelper.Dragged) continue; // check if it's able to be dropped on by current dragged entity - var dropArgs = new DragDropEventArgs(_dragger!, pvsEntity.Transform.Coordinates, _dragDropHelper.Dragged, pvsEntity); + var dropArgs = new DragDropEvent(_dragger!, pvsEntity.Transform.Coordinates, _dragDropHelper.Dragged, pvsEntity); var valid = ValidDragDrop(dropArgs); if (valid == null) continue; @@ -414,7 +414,7 @@ namespace Content.Client.GameObjects.EntitySystems /// /// /// null if the target doesn't support IDragDropOn - private bool? ValidDragDrop(DragDropEventArgs eventArgs) + private bool? ValidDragDrop(DragDropEvent eventArgs) { bool? valid = null; diff --git a/Content.IntegrationTests/Tests/Interaction/Click/InteractionSystemTests.cs b/Content.IntegrationTests/Tests/Interaction/Click/InteractionSystemTests.cs index 66d84eb846..c889a8687b 100644 --- a/Content.IntegrationTests/Tests/Interaction/Click/InteractionSystemTests.cs +++ b/Content.IntegrationTests/Tests/Interaction/Click/InteractionSystemTests.cs @@ -20,24 +20,24 @@ namespace Content.IntegrationTests.Tests.Interaction.Click [Reflect(false)] private class TestAttackEntitySystem : EntitySystem { - public EntityEventHandler AttackEvent; - public EntityEventHandler InteractUsingEvent; - public EntityEventHandler InteractHandEvent; + public EntityEventHandler AttackEvent; + public EntityEventHandler InteractUsingEvent; + public EntityEventHandler InteractHandEvent; public override void Initialize() { base.Initialize(); - SubscribeLocalEvent((e) => AttackEvent?.Invoke(e)); - SubscribeLocalEvent((e) => InteractUsingEvent?.Invoke(e)); - SubscribeLocalEvent((e) => InteractHandEvent?.Invoke(e)); + SubscribeLocalEvent((e) => AttackEvent?.Invoke(e)); + SubscribeLocalEvent((e) => InteractUsingEvent?.Invoke(e)); + SubscribeLocalEvent((e) => InteractHandEvent?.Invoke(e)); } public override void Shutdown() { base.Shutdown(); - UnsubscribeLocalEvent(); - UnsubscribeLocalEvent(); - UnsubscribeLocalEvent(); + UnsubscribeLocalEvent(); + UnsubscribeLocalEvent(); + UnsubscribeLocalEvent(); } } @@ -95,12 +95,12 @@ namespace Content.IntegrationTests.Tests.Interaction.Click }; testAttackEntitySystem.InteractUsingEvent = (ev) => { - Assert.That(ev.Attacked, Is.EqualTo(containerEntity)); + Assert.That(ev.Target, Is.EqualTo(containerEntity)); interactUsing = true; }; testAttackEntitySystem.InteractHandEvent = (ev) => { - Assert.That(ev.Attacked, Is.EqualTo(containerEntity)); + Assert.That(ev.Target, Is.EqualTo(containerEntity)); interactHand = true; }; diff --git a/Content.Server/GameObjects/Components/Chemistry/HyposprayComponent.cs b/Content.Server/GameObjects/Components/Chemistry/HyposprayComponent.cs index 8a1142837a..26adceb15a 100644 --- a/Content.Server/GameObjects/Components/Chemistry/HyposprayComponent.cs +++ b/Content.Server/GameObjects/Components/Chemistry/HyposprayComponent.cs @@ -42,7 +42,7 @@ namespace Content.Server.GameObjects.Components.Chemistry Dirty(); } - bool IAttack.ClickAttack(AttackEventArgs eventArgs) + bool IAttack.ClickAttack(AttackEvent eventArgs) { var target = eventArgs.TargetEntity; var user = eventArgs.User; diff --git a/Content.Server/GameObjects/Components/Disposal/DisposalMailingUnitComponent.cs b/Content.Server/GameObjects/Components/Disposal/DisposalMailingUnitComponent.cs index 7d1cf436aa..6588853bed 100644 --- a/Content.Server/GameObjects/Components/Disposal/DisposalMailingUnitComponent.cs +++ b/Content.Server/GameObjects/Components/Disposal/DisposalMailingUnitComponent.cs @@ -723,12 +723,12 @@ namespace Content.Server.GameObjects.Components.Disposal return TryDrop(eventArgs.User, eventArgs.Using); } - public override bool CanDragDropOn(DragDropEventArgs eventArgs) + public override bool CanDragDropOn(DragDropEvent eventArgs) { return CanInsert(eventArgs.Dragged); } - public override bool DragDropOn(DragDropEventArgs eventArgs) + public override bool DragDropOn(DragDropEvent eventArgs) { _ = TryInsert(eventArgs.Dragged, eventArgs.User); return true; diff --git a/Content.Server/GameObjects/Components/Disposal/DisposalUnitComponent.cs b/Content.Server/GameObjects/Components/Disposal/DisposalUnitComponent.cs index e206a53748..db97252d92 100644 --- a/Content.Server/GameObjects/Components/Disposal/DisposalUnitComponent.cs +++ b/Content.Server/GameObjects/Components/Disposal/DisposalUnitComponent.cs @@ -616,14 +616,14 @@ namespace Content.Server.GameObjects.Components.Disposal return TryDrop(eventArgs.User, eventArgs.Using); } - public override bool CanDragDropOn(DragDropEventArgs eventArgs) + public override bool CanDragDropOn(DragDropEvent eventArgs) { // Base is redundant given this already calls the base CanInsert // If that changes then update this return CanInsert(eventArgs.Dragged); } - public override bool DragDropOn(DragDropEventArgs eventArgs) + public override bool DragDropOn(DragDropEvent eventArgs) { _ = TryInsert(eventArgs.Dragged, eventArgs.User); return true; diff --git a/Content.Server/GameObjects/Components/GUI/StrippableComponent.cs b/Content.Server/GameObjects/Components/GUI/StrippableComponent.cs index 166a988004..2fde072b4c 100644 --- a/Content.Server/GameObjects/Components/GUI/StrippableComponent.cs +++ b/Content.Server/GameObjects/Components/GUI/StrippableComponent.cs @@ -74,7 +74,7 @@ namespace Content.Server.GameObjects.Components.GUI UserInterface.SetState(new StrippingBoundUserInterfaceState(inventory, hands, cuffs)); } - public override bool Drop(DragDropEventArgs args) + public override bool Drop(DragDropEvent args) { if (!args.User.TryGetComponent(out ActorComponent? actor)) return false; diff --git a/Content.Server/GameObjects/Components/Kitchen/KitchenSpikeComponent.cs b/Content.Server/GameObjects/Components/Kitchen/KitchenSpikeComponent.cs index 9137d44b6e..34fc5d00b7 100644 --- a/Content.Server/GameObjects/Components/Kitchen/KitchenSpikeComponent.cs +++ b/Content.Server/GameObjects/Components/Kitchen/KitchenSpikeComponent.cs @@ -67,7 +67,7 @@ namespace Content.Server.GameObjects.Components.Kitchen } - public override bool DragDropOn(DragDropEventArgs eventArgs) + public override bool DragDropOn(DragDropEvent eventArgs) { TrySpike(eventArgs.Dragged, eventArgs.User); return true; diff --git a/Content.Server/GameObjects/Components/Medical/MedicalScannerComponent.cs b/Content.Server/GameObjects/Components/Medical/MedicalScannerComponent.cs index 23586993c9..ae2dfd3e08 100644 --- a/Content.Server/GameObjects/Components/Medical/MedicalScannerComponent.cs +++ b/Content.Server/GameObjects/Components/Medical/MedicalScannerComponent.cs @@ -284,7 +284,7 @@ namespace Content.Server.GameObjects.Components.Medical } } - public override bool DragDropOn(DragDropEventArgs eventArgs) + public override bool DragDropOn(DragDropEvent eventArgs) { _bodyContainer.Insert(eventArgs.Dragged); return true; diff --git a/Content.Server/GameObjects/Components/Movement/ClimbableComponent.cs b/Content.Server/GameObjects/Components/Movement/ClimbableComponent.cs index 0536824bb0..bb7444d898 100644 --- a/Content.Server/GameObjects/Components/Movement/ClimbableComponent.cs +++ b/Content.Server/GameObjects/Components/Movement/ClimbableComponent.cs @@ -39,7 +39,7 @@ namespace Content.Server.GameObjects.Components.Movement } } - public override bool CanDragDropOn(DragDropEventArgs eventArgs) + public override bool CanDragDropOn(DragDropEvent eventArgs) { if (!base.CanDragDropOn(eventArgs)) return false; @@ -132,7 +132,7 @@ namespace Content.Server.GameObjects.Components.Movement return true; } - public override bool DragDropOn(DragDropEventArgs eventArgs) + public override bool DragDropOn(DragDropEvent eventArgs) { if (eventArgs.User == eventArgs.Dragged) { diff --git a/Content.Server/GameObjects/Components/Strap/StrapComponent.cs b/Content.Server/GameObjects/Components/Strap/StrapComponent.cs index b04e0189b9..d3d87ae239 100644 --- a/Content.Server/GameObjects/Components/Strap/StrapComponent.cs +++ b/Content.Server/GameObjects/Components/Strap/StrapComponent.cs @@ -219,7 +219,7 @@ namespace Content.Server.GameObjects.Components.Strap } } - public override bool DragDropOn(DragDropEventArgs eventArgs) + public override bool DragDropOn(DragDropEvent eventArgs) { if (!eventArgs.Dragged.TryGetComponent(out BuckleComponent? buckleComponent)) return false; return buckleComponent.TryBuckle(eventArgs.User, Owner); diff --git a/Content.Server/GameObjects/Components/Weapon/Melee/FlashComponent.cs b/Content.Server/GameObjects/Components/Weapon/Melee/FlashComponent.cs index 42e1e8d301..5295018519 100644 --- a/Content.Server/GameObjects/Components/Weapon/Melee/FlashComponent.cs +++ b/Content.Server/GameObjects/Components/Weapon/Melee/FlashComponent.cs @@ -43,7 +43,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee private bool HasUses => _uses > 0; - protected override bool OnHitEntities(IReadOnlyList entities, AttackEventArgs eventArgs) + protected override bool OnHitEntities(IReadOnlyList entities, AttackEvent eventArgs) { if (entities.Count == 0) { diff --git a/Content.Server/GameObjects/Components/Weapon/Melee/MeleeWeaponComponent.cs b/Content.Server/GameObjects/Components/Weapon/Melee/MeleeWeaponComponent.cs index 21fb3d0970..68a396c2a8 100644 --- a/Content.Server/GameObjects/Components/Weapon/Melee/MeleeWeaponComponent.cs +++ b/Content.Server/GameObjects/Components/Weapon/Melee/MeleeWeaponComponent.cs @@ -66,12 +66,12 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee [ViewVariables(VVAccess.ReadWrite)] [DataField("clickAttackEffect")] public bool ClickAttackEffect { get; set; } = true; - protected virtual bool OnHitEntities(IReadOnlyList entities, AttackEventArgs eventArgs) + protected virtual bool OnHitEntities(IReadOnlyList entities, AttackEvent eventArgs) { return true; } - bool IAttack.WideAttack(AttackEventArgs eventArgs) + bool IAttack.WideAttack(AttackEvent eventArgs) { if (!eventArgs.WideAttack) return true; @@ -126,7 +126,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee return true; } - bool IAttack.ClickAttack(AttackEventArgs eventArgs) + bool IAttack.ClickAttack(AttackEvent eventArgs) { if (eventArgs.WideAttack) return false; diff --git a/Content.Server/GameObjects/Components/Weapon/Melee/StunbatonComponent.cs b/Content.Server/GameObjects/Components/Weapon/Melee/StunbatonComponent.cs index b13258c740..aea3663c63 100644 --- a/Content.Server/GameObjects/Components/Weapon/Melee/StunbatonComponent.cs +++ b/Content.Server/GameObjects/Components/Weapon/Melee/StunbatonComponent.cs @@ -80,7 +80,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee } } - protected override bool OnHitEntities(IReadOnlyList entities, AttackEventArgs eventArgs) + protected override bool OnHitEntities(IReadOnlyList entities, AttackEvent eventArgs) { if (!Activated || entities.Count == 0 || Cell == null) return true; diff --git a/Content.Server/GameObjects/EntitySystems/BuckleSystem.cs b/Content.Server/GameObjects/EntitySystems/BuckleSystem.cs index 8b9b3c9364..066dafe27d 100644 --- a/Content.Server/GameObjects/EntitySystems/BuckleSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/BuckleSystem.cs @@ -24,7 +24,7 @@ namespace Content.Server.GameObjects.EntitySystems SubscribeLocalEvent(ContainerModified); SubscribeLocalEvent(ContainerModified); - SubscribeLocalEvent(HandleAttackHand); + SubscribeLocalEvent(HandleAttackHand); } public override void Shutdown() @@ -35,10 +35,10 @@ namespace Content.Server.GameObjects.EntitySystems UnsubscribeLocalEvent(); UnsubscribeLocalEvent(); - UnsubscribeLocalEvent(HandleAttackHand); + UnsubscribeLocalEvent(HandleAttackHand); } - private void HandleAttackHand(EntityUid uid, BuckleComponent component, AttackHandMessage args) + private void HandleAttackHand(EntityUid uid, BuckleComponent component, AttackHandEvent args) { args.Handled = component.TryUnbuckle(args.User); } diff --git a/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs b/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs index 8b7bd9d92e..fd7881d4bf 100644 --- a/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs @@ -41,7 +41,7 @@ namespace Content.Server.GameObjects.EntitySystems.Click public override void Initialize() { - SubscribeNetworkEvent(HandleDragDropMessage); + SubscribeNetworkEvent(HandleDragDropMessage); CommandBinds.Builder .Bind(EngineKeyFunctions.Use, @@ -60,7 +60,7 @@ namespace Content.Server.GameObjects.EntitySystems.Click base.Shutdown(); } - private void HandleDragDropMessage(DragDropMessage msg, EntitySessionEventArgs args) + private void HandleDragDropMessage(DragDropRequestEvent msg, EntitySessionEventArgs args) { var performer = args.SenderSession.AttachedEntity; @@ -68,7 +68,7 @@ namespace Content.Server.GameObjects.EntitySystems.Click if (!EntityManager.TryGetEntity(msg.Dropped, out var dropped)) return; if (!EntityManager.TryGetEntity(msg.Target, out var target)) return; - var interactionArgs = new DragDropEventArgs(performer, msg.DropLocation, dropped, target); + var interactionArgs = new DragDropEvent(performer, msg.DropLocation, dropped, target); // must be in range of both the target and the object they are drag / dropping // Client also does this check but ya know we gotta validate it. @@ -132,7 +132,7 @@ namespace Content.Server.GameObjects.EntitySystems.Click private void InteractionActivate(IEntity user, IEntity used) { - var activateMsg = new ActivateInWorldMessage(user, used); + var activateMsg = new ActivateInWorldEvent(user, used); RaiseLocalEvent(used.Uid, activateMsg); if (activateMsg.Handled) { @@ -404,7 +404,7 @@ namespace Content.Server.GameObjects.EntitySystems.Click /// private async void InteractAfter(IEntity user, IEntity weapon, EntityCoordinates clickLocation, bool canReach) { - var message = new AfterInteractMessage(user, weapon, null, clickLocation, canReach); + var message = new AfterInteractEvent(user, weapon, null, clickLocation, canReach); RaiseLocalEvent(weapon.Uid, message); if (message.Handled) { @@ -421,7 +421,7 @@ namespace Content.Server.GameObjects.EntitySystems.Click /// public async Task Interaction(IEntity user, IEntity weapon, IEntity attacked, EntityCoordinates clickLocation) { - var attackMsg = new InteractUsingMessage(user, weapon, attacked, clickLocation); + var attackMsg = new InteractUsingEvent(user, weapon, attacked, clickLocation); RaiseLocalEvent(attacked.Uid, attackMsg); if (attackMsg.Handled) return; @@ -442,7 +442,7 @@ namespace Content.Server.GameObjects.EntitySystems.Click } } - var afterAtkMsg = new AfterInteractMessage(user, weapon, attacked, clickLocation, true); + var afterAtkMsg = new AfterInteractEvent(user, weapon, attacked, clickLocation, true); RaiseLocalEvent(weapon.Uid, afterAtkMsg, false); if (afterAtkMsg.Handled) { @@ -461,7 +461,7 @@ namespace Content.Server.GameObjects.EntitySystems.Click /// public void Interaction(IEntity user, IEntity attacked) { - var message = new AttackHandMessage(user, attacked); + var message = new AttackHandEvent(user, attacked); RaiseLocalEvent(attacked.Uid, message); if (message.Handled) return; @@ -514,7 +514,7 @@ namespace Content.Server.GameObjects.EntitySystems.Click delayComponent.BeginDelay(); } - var useMsg = new UseInHandMessage(user, used); + var useMsg = new UseInHandEvent(user, used); RaiseLocalEvent(used.Uid, useMsg); if (useMsg.Handled) { @@ -552,7 +552,7 @@ namespace Content.Server.GameObjects.EntitySystems.Click /// public void ThrownInteraction(IEntity user, IEntity thrown) { - var throwMsg = new ThrownMessage(user, thrown); + var throwMsg = new ThrownEvent(user, thrown); RaiseLocalEvent(thrown.Uid, throwMsg); if (throwMsg.Handled) { @@ -575,7 +575,7 @@ namespace Content.Server.GameObjects.EntitySystems.Click /// public void EquippedInteraction(IEntity user, IEntity equipped, EquipmentSlotDefines.Slots slot) { - var equipMsg = new EquippedMessage(user, equipped, slot); + var equipMsg = new EquippedEvent(user, equipped, slot); RaiseLocalEvent(equipped.Uid, equipMsg); if (equipMsg.Handled) { @@ -597,7 +597,7 @@ namespace Content.Server.GameObjects.EntitySystems.Click /// public void UnequippedInteraction(IEntity user, IEntity equipped, EquipmentSlotDefines.Slots slot) { - var unequipMsg = new UnequippedMessage(user, equipped, slot); + var unequipMsg = new UnequippedEvent(user, equipped, slot); RaiseLocalEvent(equipped.Uid, unequipMsg); if (unequipMsg.Handled) { @@ -619,7 +619,7 @@ namespace Content.Server.GameObjects.EntitySystems.Click /// public void EquippedHandInteraction(IEntity user, IEntity item, SharedHand hand) { - var equippedHandMessage = new EquippedHandMessage(user, item, hand); + var equippedHandMessage = new EquippedHandEvent(user, item, hand); RaiseLocalEvent(item.Uid, equippedHandMessage); if (equippedHandMessage.Handled) { @@ -640,7 +640,7 @@ namespace Content.Server.GameObjects.EntitySystems.Click /// public void UnequippedHandInteraction(IEntity user, IEntity item, SharedHand hand) { - var unequippedHandMessage = new UnequippedHandMessage(user, item, hand); + var unequippedHandMessage = new UnequippedHandEvent(user, item, hand); RaiseLocalEvent(item.Uid, unequippedHandMessage); if (unequippedHandMessage.Handled) { @@ -673,7 +673,7 @@ namespace Content.Server.GameObjects.EntitySystems.Click /// public void DroppedInteraction(IEntity user, IEntity item, bool intentional) { - var dropMsg = new DroppedMessage(user, item, intentional); + var dropMsg = new DroppedEvent(user, item, intentional); RaiseLocalEvent(item.Uid, dropMsg); if (dropMsg.Handled) { @@ -697,7 +697,7 @@ namespace Content.Server.GameObjects.EntitySystems.Click /// public void HandSelectedInteraction(IEntity user, IEntity item) { - var handSelectedMsg = new HandSelectedMessage(user, item); + var handSelectedMsg = new HandSelectedEvent(user, item); RaiseLocalEvent(item.Uid, handSelectedMsg); if (handSelectedMsg.Handled) { @@ -719,7 +719,7 @@ namespace Content.Server.GameObjects.EntitySystems.Click /// public void HandDeselectedInteraction(IEntity user, IEntity item) { - var handDeselectedMsg = new HandDeselectedMessage(user, item); + var handDeselectedMsg = new HandDeselectedEvent(user, item); RaiseLocalEvent(item.Uid, handDeselectedMsg); if (handDeselectedMsg.Handled) { @@ -741,7 +741,7 @@ namespace Content.Server.GameObjects.EntitySystems.Click /// public async void RangedInteraction(IEntity user, IEntity weapon, IEntity attacked, EntityCoordinates clickLocation) { - var rangedMsg = new RangedInteractMessage(user, weapon, attacked, clickLocation); + var rangedMsg = new RangedInteractEvent(user, weapon, attacked, clickLocation); RaiseLocalEvent(attacked.Uid, rangedMsg); if (rangedMsg.Handled) return; @@ -759,7 +759,7 @@ namespace Content.Server.GameObjects.EntitySystems.Click } } - var afterAtkMsg = new AfterInteractMessage(user, weapon, attacked, clickLocation, false); + var afterAtkMsg = new AfterInteractEvent(user, weapon, attacked, clickLocation, false); RaiseLocalEvent(weapon.Uid, afterAtkMsg); if (afterAtkMsg.Handled) return; @@ -815,7 +815,7 @@ namespace Content.Server.GameObjects.EntitySystems.Click } } - var eventArgs = new AttackEventArgs(player, coordinates, wideAttack, targetUid); + var eventArgs = new AttackEvent(player, coordinates, wideAttack, targetUid); // Verify player has a hand, and find what object he is currently holding in his active hand if (player.TryGetComponent(out var hands)) diff --git a/Content.Server/GameObjects/EntitySystems/CloningSystem.cs b/Content.Server/GameObjects/EntitySystems/CloningSystem.cs index 37819be691..467eea5c10 100644 --- a/Content.Server/GameObjects/EntitySystems/CloningSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/CloningSystem.cs @@ -22,7 +22,7 @@ namespace Content.Server.GameObjects.EntitySystems { base.Initialize(); - SubscribeLocalEvent(HandleActivate); + SubscribeLocalEvent(HandleActivate); SubscribeLocalEvent(HandleMindAdded); } @@ -30,7 +30,7 @@ namespace Content.Server.GameObjects.EntitySystems { base.Shutdown(); - UnsubscribeLocalEvent(HandleActivate); + UnsubscribeLocalEvent(HandleActivate); UnsubscribeLocalEvent(HandleMindAdded); } @@ -46,7 +46,7 @@ namespace Content.Server.GameObjects.EntitySystems mind?.UnVisit(); } - private void HandleActivate(EntityUid uid, CloningPodComponent component, ActivateInWorldMessage args) + private void HandleActivate(EntityUid uid, CloningPodComponent component, ActivateInWorldEvent args) { if (!component.Powered || !args.User.TryGetComponent(out ActorComponent? actor)) diff --git a/Content.Server/GameObjects/EntitySystems/DisassembleOnActivateSystem.cs b/Content.Server/GameObjects/EntitySystems/DisassembleOnActivateSystem.cs index e9b9928b6a..a6ed357192 100644 --- a/Content.Server/GameObjects/EntitySystems/DisassembleOnActivateSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/DisassembleOnActivateSystem.cs @@ -18,21 +18,21 @@ namespace Content.Server.GameObjects.EntitySystems { base.Initialize(); - SubscribeLocalEvent(HandleActivateInWorld); + SubscribeLocalEvent(HandleActivateInWorld); } public override void Shutdown() { base.Shutdown(); - UnsubscribeLocalEvent(HandleActivateInWorld); + UnsubscribeLocalEvent(HandleActivateInWorld); } - private async void HandleActivateInWorld(EntityUid uid, DisassembleOnActivateComponent component, ActivateInWorldMessage args) + private async void HandleActivateInWorld(EntityUid uid, DisassembleOnActivateComponent component, ActivateInWorldEvent args) { if (string.IsNullOrEmpty(component.Prototype)) return; - if (!args.User.InRangeUnobstructed(args.Activated)) + if (!args.User.InRangeUnobstructed(args.Target)) return; if (component.DoAfterTime > 0 && TryGet(out var doAfterSystem)) diff --git a/Content.Server/GameObjects/EntitySystems/Janitorial/LightReplacerSystem.cs b/Content.Server/GameObjects/EntitySystems/Janitorial/LightReplacerSystem.cs index 4bc32cb12d..301ad2fa1d 100644 --- a/Content.Server/GameObjects/EntitySystems/Janitorial/LightReplacerSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/Janitorial/LightReplacerSystem.cs @@ -17,48 +17,48 @@ namespace Content.Server.GameObjects.EntitySystems.Janitorial { base.Initialize(); - SubscribeLocalEvent(HandleInteract); - SubscribeLocalEvent(HandleAfterInteract); + SubscribeLocalEvent(HandleInteract); + SubscribeLocalEvent(HandleAfterInteract); } public override void Shutdown() { base.Shutdown(); - UnsubscribeLocalEvent(HandleInteract); - UnsubscribeLocalEvent(HandleAfterInteract); + UnsubscribeLocalEvent(HandleInteract); + UnsubscribeLocalEvent(HandleAfterInteract); } - private void HandleAfterInteract(EntityUid uid, LightReplacerComponent component, AfterInteractMessage eventArgs) + private void HandleAfterInteract(EntityUid uid, LightReplacerComponent component, AfterInteractEvent eventArgs) { // standard interaction checks if (!ActionBlockerSystem.CanUse(eventArgs.User)) return; if (!eventArgs.CanReach) return; // behaviour will depends on target type - if (eventArgs.Attacked != null) + if (eventArgs.Target != null) { // replace broken light in fixture? - if (eventArgs.Attacked.TryGetComponent(out PoweredLightComponent? fixture)) + if (eventArgs.Target.TryGetComponent(out PoweredLightComponent? fixture)) component.TryReplaceBulb(fixture, eventArgs.User); // add new bulb to light replacer container? - else if (eventArgs.Attacked.TryGetComponent(out LightBulbComponent? bulb)) + else if (eventArgs.Target.TryGetComponent(out LightBulbComponent? bulb)) component.TryInsertBulb(bulb, eventArgs.User, true); } } - private void HandleInteract(EntityUid uid, LightReplacerComponent component, InteractUsingMessage eventArgs) + private void HandleInteract(EntityUid uid, LightReplacerComponent component, InteractUsingEvent eventArgs) { // standard interaction checks if (!ActionBlockerSystem.CanInteract(eventArgs.User)) return; - if (eventArgs.ItemInHand != null) + if (eventArgs.Used != null) { // want to insert a new light bulb? - if (eventArgs.ItemInHand.TryGetComponent(out LightBulbComponent? bulb)) + if (eventArgs.Used.TryGetComponent(out LightBulbComponent? bulb)) component.TryInsertBulb(bulb, eventArgs.User, true); // add bulbs from storage? - else if (eventArgs.ItemInHand.TryGetComponent(out ServerStorageComponent? storage)) + else if (eventArgs.Used.TryGetComponent(out ServerStorageComponent? storage)) component.TryInsertBulb(storage, eventArgs.User); } } diff --git a/Content.Server/GameObjects/EntitySystems/SpawnAfterInteractSystem.cs b/Content.Server/GameObjects/EntitySystems/SpawnAfterInteractSystem.cs index 3404224cb9..2a8296685d 100644 --- a/Content.Server/GameObjects/EntitySystems/SpawnAfterInteractSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/SpawnAfterInteractSystem.cs @@ -21,17 +21,17 @@ namespace Content.Server.GameObjects.EntitySystems { base.Initialize(); - SubscribeLocalEvent(HandleAfterInteract); + SubscribeLocalEvent(HandleAfterInteract); } public override void Shutdown() { base.Shutdown(); - UnsubscribeLocalEvent(HandleAfterInteract); + UnsubscribeLocalEvent(HandleAfterInteract); } - private async void HandleAfterInteract(EntityUid uid, SpawnAfterInteractComponent component, AfterInteractMessage args) + private async void HandleAfterInteract(EntityUid uid, SpawnAfterInteractComponent component, AfterInteractEvent args) { if (string.IsNullOrEmpty(component.Prototype)) return; diff --git a/Content.Shared/GameObjects/Components/Buckle/SharedBuckleComponent.cs b/Content.Shared/GameObjects/Components/Buckle/SharedBuckleComponent.cs index 5501c89513..0d8a414779 100644 --- a/Content.Shared/GameObjects/Components/Buckle/SharedBuckleComponent.cs +++ b/Content.Shared/GameObjects/Components/Buckle/SharedBuckleComponent.cs @@ -67,12 +67,12 @@ namespace Content.Shared.GameObjects.Components.Buckle return !Buckled; } - bool IDraggable.CanDrop(CanDropEventArgs args) + bool IDraggable.CanDrop(CanDropEvent args) { return args.Target.HasComponent(); } - bool IDraggable.Drop(DragDropEventArgs args) + bool IDraggable.Drop(DragDropEvent args) { return TryBuckle(args.User, args.Target); } diff --git a/Content.Shared/GameObjects/Components/Disposal/SharedDisposalUnitComponent.cs b/Content.Shared/GameObjects/Components/Disposal/SharedDisposalUnitComponent.cs index 0f83411a3e..d69becb5f1 100644 --- a/Content.Shared/GameObjects/Components/Disposal/SharedDisposalUnitComponent.cs +++ b/Content.Shared/GameObjects/Components/Disposal/SharedDisposalUnitComponent.cs @@ -187,11 +187,11 @@ namespace Content.Shared.GameObjects.Components.Disposal return true; } - public virtual bool CanDragDropOn(DragDropEventArgs eventArgs) + public virtual bool CanDragDropOn(DragDropEvent eventArgs) { return CanInsert(eventArgs.Dragged); } - public abstract bool DragDropOn(DragDropEventArgs eventArgs); + public abstract bool DragDropOn(DragDropEvent eventArgs); } } diff --git a/Content.Shared/GameObjects/Components/GUI/SharedStrippableComponent.cs b/Content.Shared/GameObjects/Components/GUI/SharedStrippableComponent.cs index ae9a97aae9..301fe0e3cb 100644 --- a/Content.Shared/GameObjects/Components/GUI/SharedStrippableComponent.cs +++ b/Content.Shared/GameObjects/Components/GUI/SharedStrippableComponent.cs @@ -21,14 +21,14 @@ namespace Content.Shared.GameObjects.Components.GUI && ActionBlockerSystem.CanInteract(by); } - bool IDraggable.CanDrop(CanDropEventArgs args) + bool IDraggable.CanDrop(CanDropEvent args) { return args.Target != args.Dragged && args.Target == args.User && CanBeStripped(args.User); } - public abstract bool Drop(DragDropEventArgs args); + public abstract bool Drop(DragDropEvent args); [NetSerializable, Serializable] public enum StrippingUiKey diff --git a/Content.Shared/GameObjects/Components/GUI/SharedStrippingComponent.cs b/Content.Shared/GameObjects/Components/GUI/SharedStrippingComponent.cs index 2fe703241a..bc3ec75328 100644 --- a/Content.Shared/GameObjects/Components/GUI/SharedStrippingComponent.cs +++ b/Content.Shared/GameObjects/Components/GUI/SharedStrippingComponent.cs @@ -12,13 +12,13 @@ namespace Content.Shared.GameObjects.Components.GUI { public override string Name => "Stripping"; - bool IDragDropOn.CanDragDropOn(DragDropEventArgs eventArgs) + bool IDragDropOn.CanDragDropOn(DragDropEvent eventArgs) { if (!eventArgs.Dragged.TryGetComponent(out SharedStrippableComponent? strippable)) return false; return strippable.CanBeStripped(Owner); } - bool IDragDropOn.DragDropOn(DragDropEventArgs eventArgs) + bool IDragDropOn.DragDropOn(DragDropEvent eventArgs) { // Handled by StrippableComponent return true; diff --git a/Content.Shared/GameObjects/Components/Medical/SharedMedicalScannerComponent.cs b/Content.Shared/GameObjects/Components/Medical/SharedMedicalScannerComponent.cs index 542a2a3abe..b507a205f7 100644 --- a/Content.Shared/GameObjects/Components/Medical/SharedMedicalScannerComponent.cs +++ b/Content.Shared/GameObjects/Components/Medical/SharedMedicalScannerComponent.cs @@ -80,11 +80,11 @@ namespace Content.Shared.GameObjects.Components.Medical } - bool IDragDropOn.CanDragDropOn(DragDropEventArgs eventArgs) + bool IDragDropOn.CanDragDropOn(DragDropEvent eventArgs) { return eventArgs.Dragged.HasComponent(); } - public abstract bool DragDropOn(DragDropEventArgs eventArgs); + public abstract bool DragDropOn(DragDropEvent eventArgs); } } diff --git a/Content.Shared/GameObjects/Components/Movement/SharedClimbableComponent.cs b/Content.Shared/GameObjects/Components/Movement/SharedClimbableComponent.cs index 722dd8136e..eaf4e39f16 100644 --- a/Content.Shared/GameObjects/Components/Movement/SharedClimbableComponent.cs +++ b/Content.Shared/GameObjects/Components/Movement/SharedClimbableComponent.cs @@ -18,11 +18,11 @@ namespace Content.Shared.GameObjects.Components.Movement /// [ViewVariables] [DataField("range")] protected float Range = SharedInteractionSystem.InteractionRange / 1.4f; - public virtual bool CanDragDropOn(DragDropEventArgs eventArgs) + public virtual bool CanDragDropOn(DragDropEvent eventArgs) { return eventArgs.Dragged.HasComponent(); } - public abstract bool DragDropOn(DragDropEventArgs eventArgs); + public abstract bool DragDropOn(DragDropEvent eventArgs); } } diff --git a/Content.Shared/GameObjects/Components/Nutrition/SharedButcherableComponent.cs b/Content.Shared/GameObjects/Components/Nutrition/SharedButcherableComponent.cs index e9e46952a8..3578678675 100644 --- a/Content.Shared/GameObjects/Components/Nutrition/SharedButcherableComponent.cs +++ b/Content.Shared/GameObjects/Components/Nutrition/SharedButcherableComponent.cs @@ -23,7 +23,7 @@ namespace Content.Shared.GameObjects.Components.Nutrition [DataField("meat")] private string? _meatPrototype; - public bool CanDrop(CanDropEventArgs args) + public bool CanDrop(CanDropEvent args) { return true; } diff --git a/Content.Shared/GameObjects/Components/Storage/SharedStorageComponent.cs b/Content.Shared/GameObjects/Components/Storage/SharedStorageComponent.cs index 6786b0a0a6..b870b7032d 100644 --- a/Content.Shared/GameObjects/Components/Storage/SharedStorageComponent.cs +++ b/Content.Shared/GameObjects/Components/Storage/SharedStorageComponent.cs @@ -24,13 +24,13 @@ namespace Content.Shared.GameObjects.Components.Storage /// True if no longer in storage, false otherwise public abstract bool Remove(IEntity entity); - bool IDraggable.CanDrop(CanDropEventArgs args) + bool IDraggable.CanDrop(CanDropEvent args) { return args.Target.TryGetComponent(out SharedPlaceableSurfaceComponent? placeable) && placeable.IsPlaceable; } - bool IDraggable.Drop(DragDropEventArgs eventArgs) + bool IDraggable.Drop(DragDropEvent eventArgs) { if (!ActionBlockerSystem.CanInteract(eventArgs.User)) { diff --git a/Content.Shared/GameObjects/Components/Strap/SharedStrapComponent.cs b/Content.Shared/GameObjects/Components/Strap/SharedStrapComponent.cs index e8354badd5..8c98376c31 100644 --- a/Content.Shared/GameObjects/Components/Strap/SharedStrapComponent.cs +++ b/Content.Shared/GameObjects/Components/Strap/SharedStrapComponent.cs @@ -32,7 +32,7 @@ namespace Content.Shared.GameObjects.Components.Strap public sealed override uint? NetID => ContentNetIDs.STRAP; - bool IDragDropOn.CanDragDropOn(DragDropEventArgs eventArgs) + bool IDragDropOn.CanDragDropOn(DragDropEvent eventArgs) { if (!eventArgs.Dragged.TryGetComponent(out SharedBuckleComponent? buckleComponent)) return false; bool Ignored(IEntity entity) => entity == eventArgs.User || entity == eventArgs.Dragged || entity == eventArgs.Target; @@ -40,7 +40,7 @@ namespace Content.Shared.GameObjects.Components.Strap return eventArgs.Target.InRangeUnobstructed(eventArgs.Dragged, buckleComponent.Range, predicate: Ignored); } - public abstract bool DragDropOn(DragDropEventArgs eventArgs); + public abstract bool DragDropOn(DragDropEvent eventArgs); } [Serializable, NetSerializable] diff --git a/Content.Shared/GameObjects/EntitySystemMessages/DragDropMessage.cs b/Content.Shared/GameObjects/EntitySystemMessages/DragDropRequestEvent.cs similarity index 56% rename from Content.Shared/GameObjects/EntitySystemMessages/DragDropMessage.cs rename to Content.Shared/GameObjects/EntitySystemMessages/DragDropRequestEvent.cs index c2e7098000..b20fc23458 100644 --- a/Content.Shared/GameObjects/EntitySystemMessages/DragDropMessage.cs +++ b/Content.Shared/GameObjects/EntitySystemMessages/DragDropRequestEvent.cs @@ -10,13 +10,24 @@ namespace Content.Shared.GameObjects.EntitySystemMessages /// Requests a drag / drop interaction to be performed /// [Serializable, NetSerializable] - public class DragDropMessage : EntityEventArgs + public class DragDropRequestEvent : EntityEventArgs { + /// + /// Location that the entity was dropped. + /// public EntityCoordinates DropLocation { get; } + + /// + /// Entity that was dragged and dropped. + /// public EntityUid Dropped { get; } + + /// + /// Entity that was drag dropped on. + /// public EntityUid Target { get; } - public DragDropMessage(EntityCoordinates dropLocation, EntityUid dropped, EntityUid target) + public DragDropRequestEvent(EntityCoordinates dropLocation, EntityUid dropped, EntityUid target) { DropLocation = dropLocation; Dropped = dropped; diff --git a/Content.Shared/GameObjects/EntitySystems/ExamineSystemShared.cs b/Content.Shared/GameObjects/EntitySystems/ExamineSystemShared.cs index da4c6ba971..e8b1eaada7 100644 --- a/Content.Shared/GameObjects/EntitySystems/ExamineSystemShared.cs +++ b/Content.Shared/GameObjects/EntitySystems/ExamineSystemShared.cs @@ -148,7 +148,7 @@ namespace Content.Shared.GameObjects.EntitySystems return InRangeUnOccluded(originPos, otherPos, range, predicate, ignoreInsideBlocker); } - public static bool InRangeUnOccluded(DragDropEventArgs args, float range, Ignored? predicate, bool ignoreInsideBlocker = true) + public static bool InRangeUnOccluded(DragDropEvent args, float range, Ignored? predicate, bool ignoreInsideBlocker = true) { var originPos = args.User.Transform.MapPosition; var otherPos = args.DropLocation.ToMap(args.User.EntityManager); diff --git a/Content.Shared/GameObjects/EntitySystems/SharedInteractionSystem.cs b/Content.Shared/GameObjects/EntitySystems/SharedInteractionSystem.cs index b22634441e..173888e01f 100644 --- a/Content.Shared/GameObjects/EntitySystems/SharedInteractionSystem.cs +++ b/Content.Shared/GameObjects/EntitySystems/SharedInteractionSystem.cs @@ -417,7 +417,7 @@ namespace Content.Shared.GameObjects.EntitySystems } /// - /// Checks that the user of a is within a + /// Checks that the user of a is within a /// certain distance of the target and dropped entities without any entity /// that matches the collision mask obstructing them. /// If the is zero or negative, @@ -448,7 +448,7 @@ namespace Content.Shared.GameObjects.EntitySystems /// True if the two points are within a given range without being obstructed. /// public bool InRangeUnobstructed( - DragDropEventArgs args, + DragDropEvent args, float range = InteractionRange, CollisionGroup collisionMask = CollisionGroup.Impassable, Ignored? predicate = null, @@ -544,7 +544,7 @@ namespace Content.Shared.GameObjects.EntitySystems /// /// Checks that the user and target of a - /// are within a certain distance + /// are within a certain distance /// without any entity that matches the collision mask obstructing them. /// If the is zero or negative, /// this method will only check if nothing obstructs the entity and component. @@ -574,7 +574,7 @@ namespace Content.Shared.GameObjects.EntitySystems /// True if the two points are within a given range without being obstructed. /// public bool InRangeUnobstructed( - AfterInteractMessage args, + AfterInteractEvent args, float range = InteractionRange, CollisionGroup collisionMask = CollisionGroup.Impassable, Ignored? predicate = null, @@ -582,7 +582,7 @@ namespace Content.Shared.GameObjects.EntitySystems bool popup = false) { var user = args.User; - var target = args.Attacked; + var target = args.Target; predicate ??= e => e == user; MapCoordinates otherPosition; diff --git a/Content.Shared/GameObjects/EntitySystems/ThrownItemSystem.cs b/Content.Shared/GameObjects/EntitySystems/ThrownItemSystem.cs index 50869cda91..8884534ede 100644 --- a/Content.Shared/GameObjects/EntitySystems/ThrownItemSystem.cs +++ b/Content.Shared/GameObjects/EntitySystems/ThrownItemSystem.cs @@ -38,7 +38,7 @@ namespace Content.Shared.GameObjects.EntitySystems // LandInteraction // TODO: Refactor these to system messages - var landMsg = new LandMessage(user, landing, coordinates); + var landMsg = new LandEvent(user, landing, coordinates); RaiseLocalEvent(landMsg); if (landMsg.Handled) { @@ -65,7 +65,7 @@ namespace Content.Shared.GameObjects.EntitySystems public void ThrowCollideInteraction(IEntity? user, IPhysBody thrown, IPhysBody target) { // TODO: Just pass in the bodies directly - var collideMsg = new ThrowCollideMessage(user, thrown.Owner, target.Owner); + var collideMsg = new ThrowCollideEvent(user, thrown.Owner, target.Owner); RaiseLocalEvent(collideMsg); if (collideMsg.Handled) { diff --git a/Content.Shared/Interfaces/GameObjects/Components/Interaction/IActivate.cs b/Content.Shared/Interfaces/GameObjects/Components/Interaction/IActivate.cs index 51c8ddccc7..ceb75aefd9 100644 --- a/Content.Shared/Interfaces/GameObjects/Components/Interaction/IActivate.cs +++ b/Content.Shared/Interfaces/GameObjects/Components/Interaction/IActivate.cs @@ -38,22 +38,22 @@ namespace Content.Shared.Interfaces.GameObjects.Components /// Raised when an entity is activated in the world. /// [PublicAPI] - public class ActivateInWorldMessage : HandledEntityEventArgs + public class ActivateInWorldEvent : HandledEntityEventArgs { /// - /// Entity that activated the world entity. + /// Entity that activated the target world entity. /// public IEntity User { get; } /// /// Entity that was activated in the world. /// - public IEntity Activated { get; } + public IEntity Target { get; } - public ActivateInWorldMessage(IEntity user, IEntity activated) + public ActivateInWorldEvent(IEntity user, IEntity target) { User = user; - Activated = activated; + Target = target; } } } diff --git a/Content.Shared/Interfaces/GameObjects/Components/Interaction/IAfterInteract.cs b/Content.Shared/Interfaces/GameObjects/Components/Interaction/IAfterInteract.cs index 4898f827f9..6dff0d7193 100644 --- a/Content.Shared/Interfaces/GameObjects/Components/Interaction/IAfterInteract.cs +++ b/Content.Shared/Interfaces/GameObjects/Components/Interaction/IAfterInteract.cs @@ -51,22 +51,22 @@ namespace Content.Shared.Interfaces.GameObjects.Components /// Raised when clicking on another object and no attack event was handled. /// [PublicAPI] - public class AfterInteractMessage : HandledEntityEventArgs + public class AfterInteractEvent : HandledEntityEventArgs { /// - /// Entity that triggered the attack. + /// Entity that triggered the interaction. /// public IEntity User { get; } /// - /// Entity that the User attacked with. + /// Entity that the user used to interact. /// - public IEntity ItemInHand { get; set; } + public IEntity Used { get; } /// - /// Entity that was attacked. This can be null if the attack did not click on an entity. + /// Entity that was interacted on. This can be null if the attack did not click on an entity. /// - public IEntity? Attacked { get; } + public IEntity? Target { get; } /// /// Location that the user clicked outside of their interaction range. @@ -79,13 +79,13 @@ namespace Content.Shared.Interfaces.GameObjects.Components /// public bool CanReach { get; } - public AfterInteractMessage(IEntity user, IEntity itemInHand, IEntity? attacked, + public AfterInteractEvent(IEntity user, IEntity used, IEntity? target, EntityCoordinates clickLocation, bool canReach) { User = user; - Attacked = attacked; + Used = used; + Target = target; ClickLocation = clickLocation; - ItemInHand = itemInHand; CanReach = canReach; } } diff --git a/Content.Shared/Interfaces/GameObjects/Components/Interaction/IAttack.cs b/Content.Shared/Interfaces/GameObjects/Components/Interaction/IAttack.cs index 822adb96db..e0cf6a8b3f 100644 --- a/Content.Shared/Interfaces/GameObjects/Components/Interaction/IAttack.cs +++ b/Content.Shared/Interfaces/GameObjects/Components/Interaction/IAttack.cs @@ -15,15 +15,43 @@ namespace Content.Shared.Interfaces.GameObjects.Components { // Redirects to ClickAttack by default. [Obsolete("WideAttack")] - bool WideAttack(AttackEventArgs eventArgs) => ClickAttack(eventArgs); + bool WideAttack(AttackEvent eventArgs) => ClickAttack(eventArgs); [Obsolete("Use ClickAttack instead")] - bool ClickAttack(AttackEventArgs eventArgs); + bool ClickAttack(AttackEvent eventArgs); } - public class AttackEventArgs : EntityEventArgs + /// + /// Raised when a target entity is attacked by a user. + /// + public class AttackEvent : EntityEventArgs { - public AttackEventArgs(IEntity user, EntityCoordinates clickLocation, bool wideAttack, EntityUid target = default) + /// + /// Entity that triggered the attack. + /// + public IEntity User { get; } + + /// + /// The original location that was clicked by the user. + /// + public EntityCoordinates ClickLocation { get; } + + /// + /// Indicates whether the attack creates a swing attack or attacks the target entity directly. + /// + public bool WideAttack { get; } + + /// + /// UID of the entity that was attacked. + /// + public EntityUid Target { get; } + + /// + /// Entity that was attacked. + /// + public IEntity? TargetEntity { get; } + + public AttackEvent(IEntity user, EntityCoordinates clickLocation, bool wideAttack, EntityUid target = default) { User = user; ClickLocation = clickLocation; @@ -33,11 +61,5 @@ namespace Content.Shared.Interfaces.GameObjects.Components IoCManager.Resolve().TryGetEntity(Target, out var targetEntity); TargetEntity = targetEntity; } - - public IEntity User { get; } - public EntityCoordinates ClickLocation { get; } - public bool WideAttack { get; } - public EntityUid Target { get; } - public IEntity? TargetEntity { get; } } } diff --git a/Content.Shared/Interfaces/GameObjects/Components/Interaction/IDragDropOn.cs b/Content.Shared/Interfaces/GameObjects/Components/Interaction/IDragDropOn.cs index be9250aeff..95ef0f43cd 100644 --- a/Content.Shared/Interfaces/GameObjects/Components/Interaction/IDragDropOn.cs +++ b/Content.Shared/Interfaces/GameObjects/Components/Interaction/IDragDropOn.cs @@ -18,7 +18,7 @@ namespace Content.Shared.Interfaces.GameObjects.Components /// /// /// true if is valid, false otherwise. - bool CanDragDropOn(DragDropEventArgs eventArgs); + bool CanDragDropOn(DragDropEvent eventArgs); /// /// Invoked server-side when another entity is being dragged and dropped @@ -30,6 +30,6 @@ namespace Content.Shared.Interfaces.GameObjects.Components /// true if an interaction occurred and no further interaction should /// be processed for this drop. /// - bool DragDropOn(DragDropEventArgs eventArgs); + bool DragDropOn(DragDropEvent eventArgs); } } diff --git a/Content.Shared/Interfaces/GameObjects/Components/Interaction/IDraggable.cs b/Content.Shared/Interfaces/GameObjects/Components/Interaction/IDraggable.cs index 450c8b7903..c23126a618 100644 --- a/Content.Shared/Interfaces/GameObjects/Components/Interaction/IDraggable.cs +++ b/Content.Shared/Interfaces/GameObjects/Components/Interaction/IDraggable.cs @@ -23,7 +23,7 @@ namespace Content.Shared.Interfaces.GameObjects.Components /// The information about the drag, such as who is doing it. /// /// True if the drag should be initiated, false otherwise. - bool CanStartDrag(StartDragDropEventArgs args) + bool CanStartDrag(StartDragDropEvent args) { return true; } @@ -39,7 +39,7 @@ namespace Content.Shared.Interfaces.GameObjects.Components /// True if target is a valid target to be dropped on by this component's /// entity, false otherwise. /// - bool CanDrop(CanDropEventArgs args); + bool CanDrop(CanDropEvent args); /// /// Invoked when this component's entity is being dropped on another. @@ -52,73 +52,74 @@ namespace Content.Shared.Interfaces.GameObjects.Components /// True if an interaction occurred and no further interaction should /// be processed for this drop, false otherwise. /// - bool Drop(DragDropEventArgs args) + bool Drop(DragDropEvent args) { return false; } } - public class StartDragDropEventArgs : EntityEventArgs + public class StartDragDropEvent : EntityEventArgs { /// - /// Creates a new instance of . - /// - /// The entity doing the drag and drop. - /// The entity that is being dragged and dropped. - public StartDragDropEventArgs(IEntity user, IEntity dragged) - { - User = user; - Dragged = dragged; - } - - /// - /// The entity doing the drag and drop. + /// Entity doing the drag and drop. /// public IEntity User { get; } /// - /// The entity that is being dragged. + /// Entity that is being dragged. /// public IEntity Dragged { get; } + + /// + /// Creates a new instance of . + /// + /// The entity doing the drag and drop. + /// The entity that is being dragged and dropped. + public StartDragDropEvent(IEntity user, IEntity dragged) + { + User = user; + Dragged = dragged; + } } - public class CanDropEventArgs : StartDragDropEventArgs + public class CanDropEvent : StartDragDropEvent { /// - /// Creates a new instance of . + /// The entity that + /// is being dropped onto. + /// + public IEntity Target { get; } + + /// + /// Creates a new instance of . /// /// The entity doing the drag and drop. /// The entity that is being dragged and dropped. /// The entity that is being dropped onto. - public CanDropEventArgs(IEntity user, IEntity dragged, IEntity target) : base(user, dragged) + public CanDropEvent(IEntity user, IEntity dragged, IEntity target) : base(user, dragged) { Target = target; } - - /// - /// The entity that - /// is being dropped onto. - /// - public IEntity Target { get; } } - public class DragDropEventArgs : CanDropEventArgs + public class DragDropEvent : CanDropEvent { /// - /// Creates a new instance of . + /// The location where + /// is being dropped. + /// + public EntityCoordinates DropLocation { get; } + + /// + /// Creates a new instance of . /// /// The entity doing the drag and drop. /// The location where is being dropped. /// The entity that is being dragged and dropped. /// The entity that is being dropped onto. - public DragDropEventArgs(IEntity user, EntityCoordinates dropLocation, IEntity dragged, IEntity target) : base(user, dragged, target) + public DragDropEvent(IEntity user, EntityCoordinates dropLocation, IEntity dragged, IEntity target) : base(user, dragged, target) { DropLocation = dropLocation; } - /// - /// The location where - /// is being dropped. - /// - public EntityCoordinates DropLocation { get; } } } diff --git a/Content.Shared/Interfaces/GameObjects/Components/Interaction/IDropped.cs b/Content.Shared/Interfaces/GameObjects/Components/Interaction/IDropped.cs index e4d68088b5..cb161f594c 100644 --- a/Content.Shared/Interfaces/GameObjects/Components/Interaction/IDropped.cs +++ b/Content.Shared/Interfaces/GameObjects/Components/Interaction/IDropped.cs @@ -33,7 +33,7 @@ namespace Content.Shared.Interfaces.GameObjects.Components /// Raised when an entity is dropped /// [PublicAPI] - public class DroppedMessage : HandledEntityEventArgs + public class DroppedEvent : HandledEntityEventArgs { /// /// Entity that dropped the item. @@ -50,7 +50,7 @@ namespace Content.Shared.Interfaces.GameObjects.Components /// public bool Intentional { get; } - public DroppedMessage(IEntity user, IEntity dropped, bool intentional) + public DroppedEvent(IEntity user, IEntity dropped, bool intentional) { User = user; Dropped = dropped; diff --git a/Content.Shared/Interfaces/GameObjects/Components/Interaction/IEquipped.cs b/Content.Shared/Interfaces/GameObjects/Components/Interaction/IEquipped.cs index c1f6225e3a..b7fdc830b4 100644 --- a/Content.Shared/Interfaces/GameObjects/Components/Interaction/IEquipped.cs +++ b/Content.Shared/Interfaces/GameObjects/Components/Interaction/IEquipped.cs @@ -43,10 +43,10 @@ namespace Content.Shared.Interfaces.GameObjects.Components } /// - /// Raised when equipping the entity in an inventory slot. + /// Raised when equipping an entity in an inventory slot. /// [PublicAPI] - public class EquippedMessage : HandledEntityEventArgs + public class EquippedEvent : HandledEntityEventArgs { /// /// Entity that equipped the item. @@ -59,11 +59,11 @@ namespace Content.Shared.Interfaces.GameObjects.Components public IEntity Equipped { get; } /// - /// Slot where the item was placed. + /// Slot that the item was placed into. /// public EquipmentSlotDefines.Slots Slot { get; } - public EquippedMessage(IEntity user, IEntity equipped, EquipmentSlotDefines.Slots slot) + public EquippedEvent(IEntity user, IEntity equipped, EquipmentSlotDefines.Slots slot) { User = user; Equipped = equipped; diff --git a/Content.Shared/Interfaces/GameObjects/Components/Interaction/IEquippedHand.cs b/Content.Shared/Interfaces/GameObjects/Components/Interaction/IEquippedHand.cs index 31adf0aef8..3cfb1bd7d6 100644 --- a/Content.Shared/Interfaces/GameObjects/Components/Interaction/IEquippedHand.cs +++ b/Content.Shared/Interfaces/GameObjects/Components/Interaction/IEquippedHand.cs @@ -31,10 +31,10 @@ namespace Content.Shared.Interfaces.GameObjects.Components } /// - /// Raised when putting the entity into a hand slot + /// Raised when putting an entity into a hand slot /// [PublicAPI] - public class EquippedHandMessage : HandledEntityEventArgs + public class EquippedHandEvent : HandledEntityEventArgs { /// /// Entity that equipped the item. @@ -47,11 +47,11 @@ namespace Content.Shared.Interfaces.GameObjects.Components public IEntity Equipped { get; } /// - /// Hand the item is going into. + /// Hand that the item was placed into. /// public SharedHand Hand { get; } - public EquippedHandMessage(IEntity user, IEntity equipped, SharedHand hand) + public EquippedHandEvent(IEntity user, IEntity equipped, SharedHand hand) { User = user; Equipped = equipped; diff --git a/Content.Shared/Interfaces/GameObjects/Components/Interaction/IHandDeselected.cs b/Content.Shared/Interfaces/GameObjects/Components/Interaction/IHandDeselected.cs index e24c70c876..72a62b44ba 100644 --- a/Content.Shared/Interfaces/GameObjects/Components/Interaction/IHandDeselected.cs +++ b/Content.Shared/Interfaces/GameObjects/Components/Interaction/IHandDeselected.cs @@ -30,7 +30,7 @@ namespace Content.Shared.Interfaces.GameObjects.Components /// Raised when an entity item in a hand is deselected. /// [PublicAPI] - public class HandDeselectedMessage : HandledEntityEventArgs + public class HandDeselectedEvent : HandledEntityEventArgs { /// /// Entity that owns the deselected hand. @@ -38,11 +38,11 @@ namespace Content.Shared.Interfaces.GameObjects.Components public IEntity User { get; } /// - /// The item in question. + /// Item in the hand that was deselected. /// public IEntity Item { get; } - public HandDeselectedMessage(IEntity user, IEntity item) + public HandDeselectedEvent(IEntity user, IEntity item) { User = user; Item = item; diff --git a/Content.Shared/Interfaces/GameObjects/Components/Interaction/IHandSelected.cs b/Content.Shared/Interfaces/GameObjects/Components/Interaction/IHandSelected.cs index 734162718c..d629859c28 100644 --- a/Content.Shared/Interfaces/GameObjects/Components/Interaction/IHandSelected.cs +++ b/Content.Shared/Interfaces/GameObjects/Components/Interaction/IHandSelected.cs @@ -27,10 +27,10 @@ namespace Content.Shared.Interfaces.GameObjects.Components } /// - /// Raised when an entity item in a hand is selected. + /// Raised when an item entity held by a hand is selected. /// [PublicAPI] - public class HandSelectedMessage : HandledEntityEventArgs + public class HandSelectedEvent : HandledEntityEventArgs { /// /// Entity that owns the selected hand. @@ -38,11 +38,11 @@ namespace Content.Shared.Interfaces.GameObjects.Components public IEntity User { get; } /// - /// The item in question. + /// Item in the hand that was selected. /// public IEntity Item { get; } - public HandSelectedMessage(IEntity user, IEntity item) + public HandSelectedEvent(IEntity user, IEntity item) { User = user; Item = item; diff --git a/Content.Shared/Interfaces/GameObjects/Components/Interaction/IInteractHand.cs b/Content.Shared/Interfaces/GameObjects/Components/Interaction/IInteractHand.cs index 65e903e957..bf9ed4a964 100644 --- a/Content.Shared/Interfaces/GameObjects/Components/Interaction/IInteractHand.cs +++ b/Content.Shared/Interfaces/GameObjects/Components/Interaction/IInteractHand.cs @@ -31,27 +31,26 @@ namespace Content.Shared.Interfaces.GameObjects.Components public IEntity Target { get; } } - /// - /// Raised when being clicked on or "attacked" by a user with an empty hand. + /// Raised when a target entity is interacted with by a user with an empty hand. /// [PublicAPI] - public class AttackHandMessage : HandledEntityEventArgs + public class AttackHandEvent : HandledEntityEventArgs { /// - /// Entity that triggered the attack. + /// Entity that triggered the interaction. /// public IEntity User { get; } /// - /// Entity that was attacked. + /// Entity that was interacted on. /// - public IEntity Attacked { get; } + public IEntity Target { get; } - public AttackHandMessage(IEntity user, IEntity attacked) + public AttackHandEvent(IEntity user, IEntity target) { User = user; - Attacked = attacked; + Target = target; } } } diff --git a/Content.Shared/Interfaces/GameObjects/Components/Interaction/IInteractUsing.cs b/Content.Shared/Interfaces/GameObjects/Components/Interaction/IInteractUsing.cs index 43c3ecbcaa..9c6ab56eb5 100644 --- a/Content.Shared/Interfaces/GameObjects/Components/Interaction/IInteractUsing.cs +++ b/Content.Shared/Interfaces/GameObjects/Components/Interaction/IInteractUsing.cs @@ -45,36 +45,36 @@ namespace Content.Shared.Interfaces.GameObjects.Components } /// - /// Raised when being clicked on or "attacked" by a user with an object in their hand + /// Raised when a target entity is interacted with by a user while holding an object in their hand. /// [PublicAPI] - public class InteractUsingMessage : HandledEntityEventArgs + public class InteractUsingEvent : HandledEntityEventArgs { /// - /// Entity that triggered the attack. + /// Entity that triggered the interaction. /// public IEntity User { get; } /// - /// Entity that the User attacked with. + /// Entity that the user used to interact. /// - public IEntity ItemInHand { get; } + public IEntity Used { get; } /// - /// Entity that was attacked. + /// Entity that was interacted on. /// - public IEntity Attacked { get; } + public IEntity Target { get; } /// /// The original location that was clicked by the user. /// public EntityCoordinates ClickLocation { get; } - public InteractUsingMessage(IEntity user, IEntity itemInHand, IEntity attacked, EntityCoordinates clickLocation) + public InteractUsingEvent(IEntity user, IEntity used, IEntity target, EntityCoordinates clickLocation) { User = user; - ItemInHand = itemInHand; - Attacked = attacked; + Used = used; + Target = target; ClickLocation = clickLocation; } } diff --git a/Content.Shared/Interfaces/GameObjects/Components/Interaction/ILand.cs b/Content.Shared/Interfaces/GameObjects/Components/Interaction/ILand.cs index b588f3af5c..bb99d85f4c 100644 --- a/Content.Shared/Interfaces/GameObjects/Components/Interaction/ILand.cs +++ b/Content.Shared/Interfaces/GameObjects/Components/Interaction/ILand.cs @@ -32,7 +32,7 @@ namespace Content.Shared.Interfaces.GameObjects.Components /// Raised when an entity that was thrown lands. /// [PublicAPI] - public class LandMessage : HandledEntityEventArgs + public class LandEvent : HandledEntityEventArgs { /// /// Entity that threw the item. @@ -49,7 +49,7 @@ namespace Content.Shared.Interfaces.GameObjects.Components /// public EntityCoordinates LandLocation { get; } - public LandMessage(IEntity? user, IEntity thrown, EntityCoordinates landLocation) + public LandEvent(IEntity? user, IEntity thrown, EntityCoordinates landLocation) { User = user; Thrown = thrown; diff --git a/Content.Shared/Interfaces/GameObjects/Components/Interaction/IRangedInteract.cs b/Content.Shared/Interfaces/GameObjects/Components/Interaction/IRangedInteract.cs index 20b059ba87..4a1d7f76e3 100644 --- a/Content.Shared/Interfaces/GameObjects/Components/Interaction/IRangedInteract.cs +++ b/Content.Shared/Interfaces/GameObjects/Components/Interaction/IRangedInteract.cs @@ -36,37 +36,37 @@ namespace Content.Shared.Interfaces.GameObjects.Components } /// - /// Raised when being clicked by objects outside the range of direct use. + /// Raised when an entity is interacted with that is out of the user entity's range of direct use. /// [PublicAPI] - public class RangedInteractMessage : HandledEntityEventArgs + public class RangedInteractEvent : HandledEntityEventArgs { /// - /// Entity that triggered the attack. + /// Entity that triggered the interaction. /// public IEntity User { get; } /// - /// Entity that the User attacked with. + /// Entity that the user used to interact. /// - public IEntity ItemInHand { get; set; } + public IEntity Used { get; } /// - /// Entity that was attacked. + /// Entity that was interacted on. /// - public IEntity Attacked { get; } + public IEntity Target { get; } /// /// Location that the user clicked outside of their interaction range. /// public EntityCoordinates ClickLocation { get; } - public RangedInteractMessage(IEntity user, IEntity itemInHand, IEntity attacked, EntityCoordinates clickLocation) + public RangedInteractEvent(IEntity user, IEntity used, IEntity target, EntityCoordinates clickLocation) { User = user; - ItemInHand = itemInHand; + Used = used; + Target = target; ClickLocation = clickLocation; - Attacked = attacked; } } } diff --git a/Content.Shared/Interfaces/GameObjects/Components/Interaction/IThrowCollide.cs b/Content.Shared/Interfaces/GameObjects/Components/Interaction/IThrowCollide.cs index d7340260e6..52206e9699 100644 --- a/Content.Shared/Interfaces/GameObjects/Components/Interaction/IThrowCollide.cs +++ b/Content.Shared/Interfaces/GameObjects/Components/Interaction/IThrowCollide.cs @@ -38,7 +38,7 @@ namespace Content.Shared.Interfaces.GameObjects.Components } } - public class ThrowCollideMessage : HandledEntityEventArgs + public class ThrowCollideEvent : HandledEntityEventArgs { /// /// The entity that threw . @@ -55,7 +55,7 @@ namespace Content.Shared.Interfaces.GameObjects.Components /// public IEntity Target { get; } - public ThrowCollideMessage(IEntity? user, IEntity thrown, IEntity target) + public ThrowCollideEvent(IEntity? user, IEntity thrown, IEntity target) { User = user; Thrown = thrown; diff --git a/Content.Shared/Interfaces/GameObjects/Components/Interaction/IThrown.cs b/Content.Shared/Interfaces/GameObjects/Components/Interaction/IThrown.cs index 2ec23d6e1e..06ab13284c 100644 --- a/Content.Shared/Interfaces/GameObjects/Components/Interaction/IThrown.cs +++ b/Content.Shared/Interfaces/GameObjects/Components/Interaction/IThrown.cs @@ -30,7 +30,7 @@ namespace Content.Shared.Interfaces.GameObjects.Components /// Raised when throwing the entity in your hands. /// [PublicAPI] - public class ThrownMessage : HandledEntityEventArgs + public class ThrownEvent : HandledEntityEventArgs { /// /// Entity that threw the item. @@ -42,7 +42,7 @@ namespace Content.Shared.Interfaces.GameObjects.Components /// public IEntity Thrown { get; } - public ThrownMessage(IEntity user, IEntity thrown) + public ThrownEvent(IEntity user, IEntity thrown) { User = user; Thrown = thrown; diff --git a/Content.Shared/Interfaces/GameObjects/Components/Interaction/IUnequipped.cs b/Content.Shared/Interfaces/GameObjects/Components/Interaction/IUnequipped.cs index 88068f24c6..e87308ad6e 100644 --- a/Content.Shared/Interfaces/GameObjects/Components/Interaction/IUnequipped.cs +++ b/Content.Shared/Interfaces/GameObjects/Components/Interaction/IUnequipped.cs @@ -33,10 +33,10 @@ namespace Content.Shared.Interfaces.GameObjects.Components } /// - /// Raised when removing the entity from an inventory slot. + /// Raised when removing an entity from an inventory slot. /// [PublicAPI] - public class UnequippedMessage : HandledEntityEventArgs + public class UnequippedEvent : HandledEntityEventArgs { /// /// Entity that equipped the item. @@ -49,11 +49,11 @@ namespace Content.Shared.Interfaces.GameObjects.Components public IEntity Unequipped { get; } /// - /// Slot where the item was removed from. + /// Slot that the item was removed from. /// public EquipmentSlotDefines.Slots Slot { get; } - public UnequippedMessage(IEntity user, IEntity unequipped, EquipmentSlotDefines.Slots slot) + public UnequippedEvent(IEntity user, IEntity unequipped, EquipmentSlotDefines.Slots slot) { User = user; Unequipped = unequipped; diff --git a/Content.Shared/Interfaces/GameObjects/Components/Interaction/IUnequippedHand.cs b/Content.Shared/Interfaces/GameObjects/Components/Interaction/IUnequippedHand.cs index 7178543036..c6aff9da2c 100644 --- a/Content.Shared/Interfaces/GameObjects/Components/Interaction/IUnequippedHand.cs +++ b/Content.Shared/Interfaces/GameObjects/Components/Interaction/IUnequippedHand.cs @@ -30,10 +30,10 @@ namespace Content.Shared.Interfaces.GameObjects.Components } /// - /// Raised when removing the entity from an inventory slot. + /// Raised when removing an entity from an inventory slot. /// [PublicAPI] - public class UnequippedHandMessage : HandledEntityEventArgs + public class UnequippedHandEvent : HandledEntityEventArgs { /// /// Entity that equipped the item. @@ -46,11 +46,11 @@ namespace Content.Shared.Interfaces.GameObjects.Components public IEntity Unequipped { get; } /// - /// Hand the item is removed from. + /// Hand that the item is removed from. /// public SharedHand Hand { get; } - public UnequippedHandMessage(IEntity user, IEntity unequipped, SharedHand hand) + public UnequippedHandEvent(IEntity user, IEntity unequipped, SharedHand hand) { User = user; Unequipped = unequipped; diff --git a/Content.Shared/Interfaces/GameObjects/Components/Interaction/IUse.cs b/Content.Shared/Interfaces/GameObjects/Components/Interaction/IUse.cs index 2fd2f774bc..45a64dc792 100644 --- a/Content.Shared/Interfaces/GameObjects/Components/Interaction/IUse.cs +++ b/Content.Shared/Interfaces/GameObjects/Components/Interaction/IUse.cs @@ -34,7 +34,7 @@ namespace Content.Shared.Interfaces.GameObjects.Components /// Raised when using the entity in your hands. /// [PublicAPI] - public class UseInHandMessage : HandledEntityEventArgs + public class UseInHandEvent : HandledEntityEventArgs { /// /// Entity holding the item in their hand. @@ -46,7 +46,7 @@ namespace Content.Shared.Interfaces.GameObjects.Components /// public IEntity Used { get; } - public UseInHandMessage(IEntity user, IEntity used) + public UseInHandEvent(IEntity user, IEntity used) { User = user; Used = used; diff --git a/Content.Shared/Kitchen/SharedKitchenSpikeComponent.cs b/Content.Shared/Kitchen/SharedKitchenSpikeComponent.cs index 71cbec195b..9a92adeb1f 100644 --- a/Content.Shared/Kitchen/SharedKitchenSpikeComponent.cs +++ b/Content.Shared/Kitchen/SharedKitchenSpikeComponent.cs @@ -22,7 +22,7 @@ namespace Content.Shared.Kitchen [DataField("sound")] protected string? SpikeSound = "/Audio/Effects/Fluids/splat.ogg"; - bool IDragDropOn.CanDragDropOn(DragDropEventArgs eventArgs) + bool IDragDropOn.CanDragDropOn(DragDropEvent eventArgs) { if (!eventArgs.Dragged.HasComponent()) { @@ -33,6 +33,6 @@ namespace Content.Shared.Kitchen return true; } - public abstract bool DragDropOn(DragDropEventArgs eventArgs); + public abstract bool DragDropOn(DragDropEvent eventArgs); } } diff --git a/Content.Shared/Utility/SharedUnobstructedExtensions.cs b/Content.Shared/Utility/SharedUnobstructedExtensions.cs index 1f2ec3c13c..6011c2d3ef 100644 --- a/Content.Shared/Utility/SharedUnobstructedExtensions.cs +++ b/Content.Shared/Utility/SharedUnobstructedExtensions.cs @@ -407,7 +407,7 @@ namespace Content.Shared.Utility } public static bool InRangeUnobstructed( - this DragDropEventArgs args, + this DragDropEvent args, float range = InteractionRange, CollisionGroup collisionMask = CollisionGroup.Impassable, Ignored? predicate = null, @@ -433,7 +433,7 @@ namespace Content.Shared.Utility #region EntityEventArgs public static bool InRangeUnobstructed( - this AfterInteractMessage args, + this AfterInteractEvent args, float range = InteractionRange, CollisionGroup collisionMask = CollisionGroup.Impassable, Ignored? predicate = null, diff --git a/Content.Shared/Utility/SharedUnoccludedExtensions.cs b/Content.Shared/Utility/SharedUnoccludedExtensions.cs index bd34e6cd9f..14390e8cfe 100644 --- a/Content.Shared/Utility/SharedUnoccludedExtensions.cs +++ b/Content.Shared/Utility/SharedUnoccludedExtensions.cs @@ -353,7 +353,7 @@ namespace Content.Shared.Utility } public static bool InRangeUnOccluded( - this DragDropEventArgs args, + this DragDropEvent args, float range = InteractionRange, Ignored? predicate = null, bool ignoreInsideBlocker = true)