Heroes.Element
1.0.2
dotnet add package Heroes.Element --version 1.0.2
NuGet\Install-Package Heroes.Element -Version 1.0.2
<PackageReference Include="Heroes.Element" Version="1.0.2" />
<PackageVersion Include="Heroes.Element" Version="1.0.2" />
<PackageReference Include="Heroes.Element" />
paket add Heroes.Element --version 1.0.2
#r "nuget: Heroes.Element, 1.0.2"
#:package Heroes.Element@1.0.2
#addin nuget:?package=Heroes.Element&version=1.0.2
#tool nuget:?package=Heroes.Element&version=1.0.2
Heroes Element
Heroes Element is a .NET library to read the JSON files from Heroes Data Parser and provides an API to access the data with multi-localization support.
This library only supports JSON files generated from Heroes Data Parser v5.0.0 or later.
The json files are also available in the Heroes Data repository.
Usage
There is a <data-file-name>DataDocument class for each json data file. Each provides a Load method that accepts a JsonDocument for the data file.
Example of loading the herodata file.
// load the data file
using FileStream dataFile = File.OpenRead("herodata_97039_enus.json");
using HeroDataDocument dataDocument = HeroDataDocument.Load(JsonDocument.Parse(dataFile));
// get the meta properties
MetaDataProperties metaDataProperties = dataDocument.Meta;
// get hero data for a specific hero
Hero heroData = dataDocument.GetElementById("Alarak");
// get some properties
string? attributeId = heroData.AttributeId;
GameStringText? name = heroData.Name;
GameStringText? description = heroData.Description;
IDictionary<AbilityTier, IList<Ability>> abilities = heroData.Abilities;
IDictionary<TalentTier, IList<Talent>> talents = heroData.Talents;
Or if the data file's meta.localizedText property is set to Extracted, a gamestrings file may be loaded in.
using FileStream dataFile = File.OpenRead("herodata_97039_enus.json");
using FileStream gamestringsFile = File.OpenRead("gamestrings_97039_eses.json");
using GameStringsDocument gameStringsDocument = GameStringsDocument.Load(JsonDocument.Parse(gamestringsFile));
// pass in the gameStringsDocument as the second argument
using HeroDataDocument dataDocument = HeroDataDocument.Load(JsonDocument.Parse(dataFile), gameStringsDocument);
Updating the GameStringsTexts
To update a data object's gamestrings to a different gamestrings file, such as a different locale, load the gamestrings file via the GameStringsDocument class.
// load a gamestrings file
using FileStream gamestringsFile = File.OpenRead("gamestrings_97039_frfr.json");
using GameStringsDocument gameStringsDocument = GameStringsDocument.Load(JsonDocument.Parse(gamestringsFile));
// get the meta properties
MetaGameStringProperties metaGameStringProperties = gameStringsDocument.Meta;
// update an existing heroData instance with the new gamestrings
gameStringsDocument.UpdateGameStringTexts(heroData);
// Or, use the extension method
heroData.UpdateGameStringTexts(gameStringsDocument);
Developing
To build and compile the code, it is recommended to use the latest version of Visual Studio 2026 or Visual Studio Code.
Another option is to use the dotnet CLI tools from the latest .NET SDK.
License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Heroes.LocaleText (>= 1.0.1)
-
net9.0
- Heroes.LocaleText (>= 1.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 1.0.2 | 331 | 7/4/2026 | |
| 1.0.1 | 119 | 7/3/2026 | |
| 1.0.0 | 212 | 7/1/2026 | |
| 1.0.0-alpha.4 | 193 | 6/7/2026 | |
| 1.0.0-alpha.3 | 284 | 5/30/2026 | |
| 1.0.0-alpha.2 | 316 | 5/5/2026 | |
| 1.0.0-alpha.1 | 114 | 4/19/2026 |