AttackHand with an EventArg object for a parameter

This commit is contained in:
PrPleGoo
2019-04-05 19:27:39 +02:00
parent ee7a29326d
commit 495315565a
5 changed files with 19 additions and 14 deletions

View File

@@ -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
/// </summary>
/// <param name="user"></param>
/// <returns></returns>
bool Attackhand(IEntity user);
bool AttackHand(AttackHandEventArgs eventArgs);
}
public class AttackHandEventArgs : EventArgs
{
public IEntity User { get; set; }
}
/// <summary>
@@ -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;
}