Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions NetStone/Definitions/Model/Character/CharacterGearDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,30 @@ public class GearEntryDefinition
public DefinitionsPack ItemLevel { get; set; }
}

/// <summary>
/// Definition for Facewear slot
/// </summary>
public class FacewearEntryDefinition
{
/// <summary>
/// Name of the facewear
/// </summary>
[JsonProperty("NAME")]
public DefinitionsPack Name { get; set; }

/// <summary>
/// Name of the item this facewear is unlocked by
/// </summary>
[JsonProperty("UNLOCKED_BY")]
public DefinitionsPack UnlockedBy { get; set; }

/// <summary>
/// Link to Eorzea Database for facewear
/// </summary>
[JsonProperty("DB_LINK")]
public DefinitionsPack DbLink { get; set; }
}

/// <summary>
/// Definition for Soul Crystal slot
/// </summary>
Expand Down Expand Up @@ -144,6 +168,12 @@ public class CharacterGearDefinition : IDefinition
/// </summary>
[JsonProperty("FEET")]
public GearEntryDefinition Feet { get; set; }

/// <summary>
/// Facewear
/// </summary>
[JsonProperty("FACEWEAR")]
public FacewearEntryDefinition Facewear { get; set; }

/// <summary>
/// Earrings
Expand Down
5 changes: 5 additions & 0 deletions NetStone/Model/Parseables/Character/Gear/CharacterGear.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ public CharacterGear(LodestoneClient client, HtmlNode rootNode, CharacterGearDef
/// </summary>
public GearEntry? Feet => new GearEntry(this.client, this.RootNode, this.definition.Feet).GetOptional();

/// <summary>
/// Information about the characters' facewear. Null if none equipped.
/// </summary>
public FacewearEntry? Facewear => new FacewearEntry(this.RootNode, this.definition.Facewear).GetOptional();

/// <summary>
/// Information about the characters' earrings. Null if none equipped.
/// </summary>
Expand Down
40 changes: 40 additions & 0 deletions NetStone/Model/Parseables/Character/Gear/FacewearEntry.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using System;
using HtmlAgilityPack;
using NetStone.Definitions.Model.Character;

namespace NetStone.Model.Parseables.Character.Gear;

/// <summary>
/// Represents data about a character's facewear
/// </summary>
public class FacewearEntry : LodestoneParseable, IOptionalParseable<FacewearEntry>
{
private readonly FacewearEntryDefinition definition;

///<inheritdoc />
public FacewearEntry(HtmlNode rootNode, FacewearEntryDefinition definition) : base(rootNode)
{
this.definition = definition;
}

/// <summary>
/// Name of the facewear
/// </summary>
public string ItemName => Parse(this.definition.Name);

/// <summary>
/// Name of the item this facewear is unlocked by
/// </summary>
public string? UnlockedBy => ParseTooltip(this.definition.UnlockedBy);

/// <summary>
/// Link to this facewear's Eorzea DB page.
/// </summary>
public Uri? DbLink => ParseHref(this.definition.DbLink);

///<inheritdoc />
public bool Exists => HasNode(this.definition.Name);

///<inheritdoc />
public override string ToString() => this.ItemName;
}
59 changes: 59 additions & 0 deletions NetStone/NetStone.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.