Skip to content

Commit 6b40759

Browse files
committed
cache gamedata
1 parent dcb3b97 commit 6b40759

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

Diff for: NetStone.GameData.Lumina/LuminaGameDataProvider.cs

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88

99
namespace NetStone.GameData.Lumina
1010
{
11+
/// <summary>
12+
/// Game data provider that reads data directly from Lumina.
13+
/// This is slow and just exists as an alternative to the flatbuffer-based solution.
14+
/// </summary>
1115
public class LuminaGameDataProvider : IGameDataProvider
1216
{
1317
private readonly Cyalume lumina;

Diff for: NetStone/Model/Parseables/Character/Gear/GearEntry.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ public class GearEntry : LodestoneParseable, IOptionalParseable<GearEntry>
1717
private readonly LodestoneClient client;
1818
private readonly GearEntryDefinition definition;
1919

20+
private NamedGameData? cachedGameData;
21+
2022
public GearEntry(LodestoneClient client, HtmlNode rootNode, GearEntryDefinition definition) : base(rootNode)
2123
{
2224
this.client = client;
@@ -74,7 +76,8 @@ public GearEntry(LodestoneClient client, HtmlNode rootNode, GearEntryDefinition
7476

7577
public NamedGameData? GetGameData()
7678
{
77-
return !Exists ? null : client.Data?.GetItem(ItemName);
79+
cachedGameData ??= !Exists ? null : client.Data?.GetItem(ItemName);
80+
return cachedGameData;
7881
}
7982

8083
/// <summary>

0 commit comments

Comments
 (0)