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