Add arguments to part and mechanism event methods (#2293)

This commit is contained in:
DrSmugleaf
2020-10-19 15:23:59 +02:00
committed by GitHub
parent 19d32eb4ce
commit 7ad46ddabf
9 changed files with 175 additions and 146 deletions

View File

@@ -50,7 +50,7 @@ namespace Content.Shared.GameObjects.Components.Body.Part
if (value != null)
{
AddedToBody();
AddedToBody(value);
}
}
}
@@ -284,14 +284,14 @@ namespace Content.Shared.GameObjects.Components.Body.Part
return true;
}
private void AddedToBody()
private void AddedToBody(IBody body)
{
Owner.Transform.AttachParent(Body!.Owner);
OnAddedToBody();
OnAddedToBody(body);
foreach (var mechanism in _mechanisms)
{
mechanism.AddedToBody();
mechanism.AddedToBody(body);
}
}
@@ -310,7 +310,7 @@ namespace Content.Shared.GameObjects.Components.Body.Part
}
}
protected virtual void OnAddedToBody() { }
protected virtual void OnAddedToBody(IBody body) { }
protected virtual void OnRemovedFromBody(IBody old) { }
}