2021-07-17 02:37:09 +02:00
|
|
|
|
using System;
|
2021-11-11 16:10:57 -07:00
|
|
|
|
using Content.Shared.Body.Components;
|
2021-10-16 15:28:02 -07:00
|
|
|
|
using Robust.Shared.Serialization;
|
2020-10-10 15:25:13 +02:00
|
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
|
namespace Content.Shared.Body.Part
|
2020-10-10 15:25:13 +02:00
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// This interface gives components behavior when a body part
|
|
|
|
|
|
/// is removed from their owning entity.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public interface IBodyPartRemoved
|
|
|
|
|
|
{
|
2020-11-15 04:22:59 +01:00
|
|
|
|
/// <summary>
|
2021-06-16 16:44:38 +02:00
|
|
|
|
/// Called when a <see cref="SharedBodyPartComponent"/> is removed from the
|
2020-11-15 04:22:59 +01:00
|
|
|
|
/// entity owning this component.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="args">Information about the part that was removed.</param>
|
2020-10-10 15:25:13 +02:00
|
|
|
|
void BodyPartRemoved(BodyPartRemovedEventArgs args);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-10-16 15:28:02 -07:00
|
|
|
|
[Serializable, NetSerializable]
|
2022-02-16 00:23:23 -07:00
|
|
|
|
public sealed class BodyPartRemovedEventArgs : EventArgs
|
2020-10-10 15:25:13 +02:00
|
|
|
|
{
|
2021-06-16 16:44:38 +02:00
|
|
|
|
public BodyPartRemovedEventArgs(string slot, SharedBodyPartComponent part)
|
2020-10-10 15:25:13 +02:00
|
|
|
|
{
|
|
|
|
|
|
Slot = slot;
|
2021-04-05 14:54:51 +02:00
|
|
|
|
Part = part;
|
2020-10-10 15:25:13 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
2020-11-15 04:22:59 +01:00
|
|
|
|
/// <summary>
|
2021-04-05 14:54:51 +02:00
|
|
|
|
/// The slot that <see cref="Part"/> was removed from.
|
2020-11-15 04:22:59 +01:00
|
|
|
|
/// </summary>
|
2021-04-05 14:54:51 +02:00
|
|
|
|
public string Slot { get; }
|
2020-10-10 15:25:13 +02:00
|
|
|
|
|
2020-11-15 04:22:59 +01:00
|
|
|
|
/// <summary>
|
2021-04-05 14:54:51 +02:00
|
|
|
|
/// The part that was removed.
|
2020-11-15 04:22:59 +01:00
|
|
|
|
/// </summary>
|
2021-06-16 16:44:38 +02:00
|
|
|
|
public SharedBodyPartComponent Part { get; }
|
2020-10-10 15:25:13 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|