Add inhands support for startingGear (#1166)

Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
This commit is contained in:
metalgearsloth
2020-06-22 06:37:03 +10:00
committed by GitHub
parent d91a8c4925
commit b6966a9b7f
2 changed files with 19 additions and 1 deletions

View File

@@ -15,6 +15,12 @@ namespace Content.Shared.Jobs
private string _id;
private Dictionary<Slots, string> _equipment;
public IReadOnlyDictionary<string, string> Inhand => _inHand;
/// <summary>
/// hand index, item prototype
/// </summary>
private Dictionary<string, string> _inHand;
[ViewVariables] public string ID => _id;
[ViewVariables] public IReadOnlyDictionary<Slots, string> Equipment => _equipment;
@@ -24,6 +30,7 @@ namespace Content.Shared.Jobs
var serializer = YamlObjectSerializer.NewReader(mapping);
serializer.DataField(ref _id, "id", string.Empty);
serializer.DataField(ref _inHand, "inhand", new Dictionary<string, string>(0));
var equipment = serializer.ReadDataField<Dictionary<string, string>>("equipment");