using System.Collections.Generic; using Content.Shared.Preferences; using Robust.Shared.Prototypes; using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.ViewVariables; using static Content.Shared.Inventory.EquipmentSlotDefines; namespace Content.Shared.Roles { [Prototype("startingGear")] public class StartingGearPrototype : IPrototype { [DataField("equipment")] private Dictionary _equipment = new(); /// /// if empty, there is no skirt override - instead the uniform provided in equipment is added. /// [DataField("innerclothingskirt")] private string _innerClothingSkirt = default!; [DataField("satchel")] private string _satchel = string.Empty; [DataField("duffelbag")] private string _duffelbag = string.Empty; public IReadOnlyDictionary Inhand => _inHand; /// /// hand index, item prototype /// [DataField("inhand")] private Dictionary _inHand = new(0); [ViewVariables] [DataField("id", required: true)] public string ID { get; } = default!; public string GetGear(Slots slot, HumanoidCharacterProfile? profile) { if (profile != null) { if ((slot == Slots.INNERCLOTHING) && (profile.Clothing == ClothingPreference.Jumpskirt) && (_innerClothingSkirt != "")) return _innerClothingSkirt; if ((slot == Slots.BACKPACK) && (profile.Backpack == BackpackPreference.Satchel) && (_satchel != "")) return _satchel; if ((slot == Slots.BACKPACK) && (profile.Backpack == BackpackPreference.Duffelbag) && (_duffelbag != "")) return _duffelbag; } if (_equipment.ContainsKey(slot)) { return _equipment[slot]; } else { return ""; } } } }