diff --git a/NetStone/Definitions/Model/Character/CharacterGearDefinition.cs b/NetStone/Definitions/Model/Character/CharacterGearDefinition.cs index 480573f..f2030f6 100644 --- a/NetStone/Definitions/Model/Character/CharacterGearDefinition.cs +++ b/NetStone/Definitions/Model/Character/CharacterGearDefinition.cs @@ -80,6 +80,30 @@ public class GearEntryDefinition public DefinitionsPack ItemLevel { get; set; } } +/// +/// Definition for Facewear slot +/// +public class FacewearEntryDefinition +{ + /// + /// Name of the facewear + /// + [JsonProperty("NAME")] + public DefinitionsPack Name { get; set; } + + /// + /// Name of the item this facewear is unlocked by + /// + [JsonProperty("UNLOCKED_BY")] + public DefinitionsPack UnlockedBy { get; set; } + + /// + /// Link to Eorzea Database for facewear + /// + [JsonProperty("DB_LINK")] + public DefinitionsPack DbLink { get; set; } +} + /// /// Definition for Soul Crystal slot /// @@ -144,6 +168,12 @@ public class CharacterGearDefinition : IDefinition /// [JsonProperty("FEET")] public GearEntryDefinition Feet { get; set; } + + /// + /// Facewear + /// + [JsonProperty("FACEWEAR")] + public FacewearEntryDefinition Facewear { get; set; } /// /// Earrings diff --git a/NetStone/Model/Parseables/Character/Gear/CharacterGear.cs b/NetStone/Model/Parseables/Character/Gear/CharacterGear.cs index 913ac5f..236976c 100644 --- a/NetStone/Model/Parseables/Character/Gear/CharacterGear.cs +++ b/NetStone/Model/Parseables/Character/Gear/CharacterGear.cs @@ -63,6 +63,11 @@ public CharacterGear(LodestoneClient client, HtmlNode rootNode, CharacterGearDef /// public GearEntry? Feet => new GearEntry(this.client, this.RootNode, this.definition.Feet).GetOptional(); + /// + /// Information about the characters' facewear. Null if none equipped. + /// + public FacewearEntry? Facewear => new FacewearEntry(this.RootNode, this.definition.Facewear).GetOptional(); + /// /// Information about the characters' earrings. Null if none equipped. /// diff --git a/NetStone/Model/Parseables/Character/Gear/FacewearEntry.cs b/NetStone/Model/Parseables/Character/Gear/FacewearEntry.cs new file mode 100644 index 0000000..b0bd54e --- /dev/null +++ b/NetStone/Model/Parseables/Character/Gear/FacewearEntry.cs @@ -0,0 +1,40 @@ +using System; +using HtmlAgilityPack; +using NetStone.Definitions.Model.Character; + +namespace NetStone.Model.Parseables.Character.Gear; + +/// +/// Represents data about a character's facewear +/// +public class FacewearEntry : LodestoneParseable, IOptionalParseable +{ + private readonly FacewearEntryDefinition definition; + + /// + public FacewearEntry(HtmlNode rootNode, FacewearEntryDefinition definition) : base(rootNode) + { + this.definition = definition; + } + + /// + /// Name of the facewear + /// + public string ItemName => Parse(this.definition.Name); + + /// + /// Name of the item this facewear is unlocked by + /// + public string? UnlockedBy => ParseTooltip(this.definition.UnlockedBy); + + /// + /// Link to this facewear's Eorzea DB page. + /// + public Uri? DbLink => ParseHref(this.definition.DbLink); + + /// + public bool Exists => HasNode(this.definition.Name); + + /// + public override string ToString() => this.ItemName; +} \ No newline at end of file diff --git a/NetStone/NetStone.xml b/NetStone/NetStone.xml index 22f2ad4..28b037f 100644 --- a/NetStone/NetStone.xml +++ b/NetStone/NetStone.xml @@ -788,6 +788,26 @@ Item level of the item + + + Definition for Facewear slot + + + + + Name of the facewear + + + + + Name of the item this facewear is unlocked by + + + + + Link to Eorzea Database for facewear + + Definition for Soul Crystal slot @@ -843,6 +863,11 @@ Feet + + + Facewear + + Earrings @@ -2836,6 +2861,11 @@ Information about the characters' shoes. Null if none equipped. + + + Information about the characters' facewear. Null if none equipped. + + Information about the characters' earrings. Null if none equipped. @@ -2866,6 +2896,35 @@ Information about the characters' soul crystal. Null if none equipped. + + + Represents data about a character's facewear + + + + + + + + Name of the facewear + + + + + Name of the item this facewear is unlocked by + + + + + Link to this facewear's Eorzea DB page. + + + + + + + + Container class holding information about a gear slot.