#nullable enable using System; using System.Collections.Generic; using Content.Shared.GameObjects.Components.Body.Behavior; using Content.Shared.GameObjects.Components.Body.Part; using Robust.Shared.Interfaces.GameObjects; namespace Content.Shared.GameObjects.Components.Body.Mechanism { public interface IMechanism : IComponent { /// /// The body that owns the in which this /// is in. /// IBody? Body { get; } /// /// The part in which this is in. /// IBodyPart? Part { get; set; } /// /// The behaviors attached to this /// mapped by their type. /// IReadOnlyDictionary Behaviors { get; } /// /// Max HP of this . /// int MaxDurability { get; set; } /// /// Current HP of this . /// int CurrentDurability { get; set; } /// /// At what HP this is completely destroyed. /// int DestroyThreshold { get; set; } /// /// Armor of this against attacks. /// int Resistance { get; set; } /// /// Determines a handful of things - mostly whether this /// can fit into a . /// // TODO BODY OnSizeChanged int Size { get; set; } /// /// What kind of this /// can be easily installed into. /// BodyPartCompatibility Compatibility { get; set; } /// /// Adds a if this /// does not have it already. /// /// The behavior type to add. /// /// True if the behavior already existed, false if it had to be created. /// bool EnsureBehavior(out T behavior) where T : IMechanismBehavior, new(); /// /// Checks if this has the specified /// . /// /// /// The type of to check for. /// /// /// true if it has the , false otherwise. /// bool HasBehavior() where T : IMechanismBehavior; /// /// Removes the specified from this /// if it has it. /// /// /// The type of to remove. /// /// true if it was removed, false otherwise. bool TryRemoveBehavior() where T : IMechanismBehavior; /// /// Runs an update cycle for this . /// /// /// The amount of seconds that passed since the last update. /// void Update(float frameTime); // TODO BODY Turn these into event listeners so they dont need to be exposed /// /// 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 this 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 this 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 this was added to. /// /// /// The part that this 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 this 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 this 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 this was removed from. /// /// /// The part that this was removed from. /// void RemovedFromPartInBody(IBody oldBody, IBodyPart oldPart); } }