diff --git a/Content.Server/GameObjects/Components/Doors/ServerDoorComponent.cs b/Content.Server/GameObjects/Components/Doors/ServerDoorComponent.cs index d8c52b018c..de39cee46d 100644 --- a/Content.Server/GameObjects/Components/Doors/ServerDoorComponent.cs +++ b/Content.Server/GameObjects/Components/Doors/ServerDoorComponent.cs @@ -41,7 +41,7 @@ namespace Content.Server.GameObjects base.OnRemove(); } - public bool Attackhand(IEntity user) + public bool AttackHand(AttackHandEventArgs eventArgs) { if (_state == DoorState.Open) { diff --git a/Content.Server/GameObjects/Components/Items/Storage/ItemComponent.cs b/Content.Server/GameObjects/Components/Items/Storage/ItemComponent.cs index f9e3bf69c6..153c730948 100644 --- a/Content.Server/GameObjects/Components/Items/Storage/ItemComponent.cs +++ b/Content.Server/GameObjects/Components/Items/Storage/ItemComponent.cs @@ -2,10 +2,11 @@ using SS14.Server.Interfaces.GameObjects; using Content.Shared.GameObjects; using SS14.Shared.Interfaces.GameObjects; +using Content.Server.GameObjects.EntitySystems; namespace Content.Server.GameObjects { - public class ItemComponent : StoreableComponent, EntitySystems.IAttackHand + public class ItemComponent : StoreableComponent, IAttackHand { public override string Name => "Item"; @@ -26,9 +27,9 @@ namespace Content.Server.GameObjects } } - public bool Attackhand(IEntity user) + public bool AttackHand(AttackHandEventArgs eventArgs) { - var hands = user.GetComponent(); + var hands = eventArgs.User.GetComponent(); hands.PutInHand(this, hands.ActiveIndex, fallback: false); return true; } diff --git a/Content.Server/GameObjects/Components/Power/ApcComponent.cs b/Content.Server/GameObjects/Components/Power/ApcComponent.cs index e8d32c9279..b63cd37330 100644 --- a/Content.Server/GameObjects/Components/Power/ApcComponent.cs +++ b/Content.Server/GameObjects/Components/Power/ApcComponent.cs @@ -106,9 +106,9 @@ namespace Content.Server.GameObjects.Components.Power return net.Lack > 0 ? ApcExternalPowerState.Low : ApcExternalPowerState.Good; } - bool IAttackHand.Attackhand(IEntity user) + bool IAttackHand.AttackHand(AttackHandEventArgs eventArgs) { - if (!user.TryGetComponent(out IActorComponent actor)) + if (!eventArgs.User.TryGetComponent(out IActorComponent actor)) { return false; } diff --git a/Content.Server/GameObjects/Components/Power/PoweredLightComponent.cs b/Content.Server/GameObjects/Components/Power/PoweredLightComponent.cs index 48c38d62cb..91b9065086 100644 --- a/Content.Server/GameObjects/Components/Power/PoweredLightComponent.cs +++ b/Content.Server/GameObjects/Components/Power/PoweredLightComponent.cs @@ -55,16 +55,16 @@ namespace Content.Server.GameObjects.Components.Power return InsertBulb(eventArgs.AttackWith); } - bool IAttackHand.Attackhand(IEntity user) + bool IAttackHand.AttackHand(AttackHandEventArgs eventArgs) { - if (user.GetComponent().GetSlotItem(EquipmentSlotDefines.Slots.GLOVES) != null) + if (eventArgs.User.GetComponent().GetSlotItem(EquipmentSlotDefines.Slots.GLOVES) != null) { - EjectBulb(user); + EjectBulb(eventArgs.User); UpdateLight(); return true; } - if (!user.TryGetComponent(out DamageableComponent damageableComponent)) return false; + if (!eventArgs.User.TryGetComponent(out DamageableComponent damageableComponent)) return false; damageableComponent.TakeDamage(DamageType.Heat, 20); return true; } diff --git a/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs b/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs index 4b13e8aee1..a67252fd12 100644 --- a/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs @@ -30,9 +30,8 @@ namespace Content.Server.GameObjects.EntitySystems bool AttackBy(AttackByEventArgs eventArgs); } - public class AttackByEventArgs : EventArgs + public class AttackByEventArgs : AttackHandEventArgs { - public IEntity User { get; set; } public IEntity AttackWith { get; set; } } @@ -46,7 +45,12 @@ namespace Content.Server.GameObjects.EntitySystems /// /// /// - bool Attackhand(IEntity user); + bool AttackHand(AttackHandEventArgs eventArgs); + } + + public class AttackHandEventArgs : EventArgs + { + public IEntity User { get; set; } } /// @@ -301,7 +305,7 @@ namespace Content.Server.GameObjects.EntitySystems for (var i = 0; i < interactables.Count; i++) { - if (interactables[i].Attackhand(user)) //If an attackby returns a status completion we finish our attack + if (interactables[i].AttackHand(new AttackHandEventArgs { User = user})) //If an attackby returns a status completion we finish our attack { return; }