#nullable enable using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using Content.Server.Body.Mechanisms; using Content.Server.GameObjects.Components.Body; using Content.Shared.Body.Part.Properties; using Content.Shared.GameObjects.Components.Body; using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.Maths; namespace Content.Server.Body { public interface IBodyPart { /// /// The body that this body part is currently in, if any. /// IBodyManagerComponent? Body { get; set; } /// /// that this is considered /// to be. /// For example, . /// BodyPartType PartType { get; } /// /// The name of this , often displayed to the user. /// For example, it could be named "advanced robotic arm". /// public string Name { get; } /// /// Plural version of this name. /// public string Plural { get; } /// /// Determines many things: how many mechanisms can be fit inside this /// , whether a body can fit through tiny crevices, /// etc. /// int Size { get; } /// /// Max HP of this . /// int MaxDurability { get; } /// /// Current HP of this based on sum of all damage types. /// int CurrentDurability { get; } /// /// Collection of all s currently inside this /// . /// To add and remove from this list see and /// /// IReadOnlyCollection Mechanisms { get; } /// /// Path to the RSI that represents this . /// public string RSIPath { get; } /// /// RSI state that represents this . /// public string RSIState { get; } /// /// RSI map keys that this body part changes on the sprite. /// public Enum? RSIMap { get; set; } /// /// RSI color of this body part. /// // TODO: SpriteComponent rework public Color? RSIColor { get; set; } /// /// If body part is vital /// public bool IsVital { get; } bool HasProperty() where T : BodyPartProperty; bool HasProperty(Type type); bool TryGetProperty([NotNullWhen(true)] out T? property) where T : BodyPartProperty; void PreMetabolism(float frameTime); void PostMetabolism(float frameTime); bool SpawnDropped([NotNullWhen(true)] out IEntity? dropped); /// /// Checks if the given can be used on /// the current state of this . /// /// True if it can be used, false otherwise. bool SurgeryCheck(SurgeryType surgery); /// /// Checks if another can be connected to this one. /// /// The part to connect. /// True if it can be connected, false otherwise. bool CanAttachPart(IBodyPart part); /// /// Checks if a can be installed on this /// . /// /// True if it can be installed, false otherwise. bool CanInstallMechanism(IMechanism mechanism); /// /// Tries to remove the given reference from /// this . /// /// /// The newly spawned , or null /// if there was an error in spawning the entity or removing the mechanism. /// bool TryDropMechanism(IEntity dropLocation, IMechanism mechanismTarget, [NotNullWhen(true)] out DroppedMechanismComponent dropped); bool DestroyMechanism(IMechanism mechanism); } }