using System; using System.Collections.Generic; using Content.Shared.BodySystem; using Robust.Shared.Prototypes; using Robust.Shared.Serialization; using Robust.Shared.ViewVariables; using YamlDotNet.RepresentationModel; namespace Content.Server.BodySystem { /// /// Data class representing a persistent item inside a . This includes livers, eyes, cameras, brains, explosive implants, binary communicators, and other things. /// public class Mechanism { [ViewVariables] public string Name { get; set; } /// /// Professional description of the Mechanism. /// [ViewVariables] public string Description { get; set; } /// /// The message to display upon examining a mob with this Mechanism installed. If the string is empty (""), no message will be displayed. /// [ViewVariables] public string ExamineMessage { get; set; } /// /// Path to the RSI that represents this Mechanism. /// [ViewVariables] public string RSIPath { get; set; } /// /// RSI state that represents this Mechanism. /// [ViewVariables] public string RSIState { get; set; } /// /// Max HP of this Mechanism. /// [ViewVariables] public int MaxDurability { get; set; } /// /// Current HP of this Mechanism. /// [ViewVariables] public int CurrentDurability { get; set; } /// /// At what HP this Mechanism is completely destroyed. /// [ViewVariables] public int DestroyThreshold { get; set; } /// /// Armor of this Mechanism against attacks. /// [ViewVariables] public int Resistance { get; set; } /// /// Determines a handful of things - mostly whether this Mechanism can fit into a BodyPart. /// [ViewVariables] public int Size { get; set; } /// /// What kind of BodyParts this Mechanism can be easily installed into. /// [ViewVariables] public BodyPartCompatibility Compatibility { get; set; } public Mechanism(MechanismPrototype data) { LoadFromPrototype(data); } /// /// Loads the given - current data on this Mechanism will be overwritten! /// public void LoadFromPrototype(MechanismPrototype data) { Name = data.Name; Description = data.Description; ExamineMessage = data.ExamineMessage; RSIPath = data.RSIPath; RSIState = data.RSIState; MaxDurability = data.Durability; CurrentDurability = MaxDurability; DestroyThreshold = data.DestroyThreshold; Resistance = data.Resistance; Size = data.Size; Compatibility = data.Compatibility; } } }