using Content.Shared.Construction.Conditions; using Content.Shared.Whitelist; using Robust.Shared.Prototypes; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; using Robust.Shared.Utility; namespace Content.Shared.Construction.Prototypes; [Prototype] public sealed partial class ConstructionPrototype : IPrototype { [DataField("conditions")] private List _conditions = new(); /// /// Hide from the construction list /// [DataField("hide")] public bool Hide = false; /// /// Friendly name displayed in the construction GUI. /// [DataField("name")] public string Name = string.Empty; /// /// "Useful" description displayed in the construction GUI. /// [DataField("description")] public string Description = string.Empty; /// /// The this construction will be using. /// [DataField("graph", customTypeSerializer: typeof(PrototypeIdSerializer), required: true)] public string Graph = string.Empty; /// /// The target this construction will guide the user to. /// [DataField("targetNode")] public string TargetNode = string.Empty; /// /// The starting this construction will start at. /// [DataField("startNode")] public string StartNode = string.Empty; /// /// Texture path inside the construction GUI. /// [DataField("icon")] public SpriteSpecifier Icon = SpriteSpecifier.Invalid; /// /// Texture paths used for the construction ghost. /// [DataField("layers")] private List? _layers; /// /// If you can start building or complete steps on impassable terrain. /// [DataField("canBuildInImpassable")] public bool CanBuildInImpassable { get; private set; } [DataField("agemax")] public int AgeMax { get; set; } = 8; [DataField("agemin")] public int AgeMin { get; set; } = 8; /// /// If this crafting recipe is available in TDM. /// [DataField("tdm")] public bool TDM { get; set; } = false; /// /// If not null, then this is used to check if the entity trying to construct this is whitelisted. /// If they're not whitelisted, hide the item. /// [DataField("entityWhitelist")] public EntityWhitelist? EntityWhitelist = null; [DataField("category")] public string Category { get; private set; } = ""; [DataField("objectType")] public ConstructionType Type { get; private set; } = ConstructionType.Structure; [ViewVariables] [IdDataField] public string ID { get; private set; } = default!; [DataField("placementMode")] public string PlacementMode = "PlaceFree"; /// /// Whether this construction can be constructed rotated or not. /// [DataField("canRotate")] public bool CanRotate = true; /// /// Construction to replace this construction with when the current one is 'flipped' /// [DataField("mirror", customTypeSerializer: typeof(PrototypeIdSerializer))] public string? Mirror; public IReadOnlyList Conditions => _conditions; public IReadOnlyList Layers => _layers ?? new List { Icon }; } public enum ConstructionType { Structure, Item, }