#nullable enable
using Content.Shared.Body.Components;
using Content.Shared.Body.Mechanism;
using Content.Shared.Body.Part;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization.Manager.Attributes;
namespace Content.Shared.Body.Behavior
{
///
/// Gives functionality to a when added to it.
///
[ImplicitDataDefinitionForInheritors]
public interface IMechanismBehavior
{
///
/// The body that owns the in which the
/// that owns this
/// is in.
///
IBody? Body { get; }
///
/// The part in which the that owns this
/// is in.
///
IBodyPart? Part { get; }
///
/// Upward reference to the parent that this
/// behavior is attached to.
///
IMechanism Parent { get; }
///
/// The entity that owns .
/// For the entity owning the body that this mechanism may be in,
/// see 's .
///
IEntity Owner { get; }
///
/// Called when this is added to a
/// , during .
/// If it is added after component initialization,
/// it is called immediately.
///
///
/// The mechanism that owns this .
///
void Initialize(IMechanism parent);
///
/// Called when this is added to a
/// , during .
/// If it is added after component startup, it is called immediately.
///
void Startup();
///
/// Runs an update cycle on this .
///
///
/// The amount of seconds that passed since the last update.
///
void Update(float frameTime);
///
/// Called when the containing is attached to a
/// .
/// For instance, attaching a head with a brain inside to a body.
/// DO NOT CALL THIS DIRECTLY FROM OUTSIDE BODY SYSTEM CODE!
///
///
/// The body that the containing was added to.
///
void AddedToBody(IBody body);
///
/// Called when the parent is
/// added into a that is not attached to a
/// .
/// For instance, adding a brain to a dismembered head.
/// DO NOT CALL THIS DIRECTLY FROM OUTSIDE BODY SYSTEM CODE!
///
///
/// The part that the containing was added to.
///
void AddedToPart(IBodyPart part);
///
/// Called when the parent is added to a
/// that is attached to a .
/// For instance, adding a brain to a head that is attached to a body.
/// DO NOT CALL THIS DIRECTLY FROM OUTSIDE BODY SYSTEM CODE!
///
///
/// The body that the containing was added to.
///
///
/// The part that the containing was added to.
///
void AddedToPartInBody(IBody body, IBodyPart part);
///
/// Called when the parent is removed from a
/// .
/// For instance, removing a head with a brain inside from a body.
/// DO NOT CALL THIS DIRECTLY FROM OUTSIDE BODY SYSTEM CODE!
///
///
/// The body that the containing was removed from.
///
void RemovedFromBody(IBody old);
///
/// Called when the parent is
/// removed from a that is not attached to a
/// .
/// For instance, removing a brain from a dismembered head.
/// DO NOT CALL THIS DIRECTLY FROM OUTSIDE BODY SYSTEM CODE!
///
///
/// The part that the containing was removed from.
///
void RemovedFromPart(IBodyPart old);
///
/// Called when the parent is removed from a
/// that is attached to a .
/// For instance, removing a brain from a head that is attached to a body.
/// DO NOT CALL THIS DIRECTLY FROM OUTSIDE BODY SYSTEM CODE!
///
///
/// The body that the containing was removed from.
///
///
/// The part that the containing was removed from.
///
void RemovedFromPartInBody(IBody oldBody, IBodyPart oldPart);
}
}