Hardstuck.GuildWars2.BuildCodes 2.2.5

dotnet add package Hardstuck.GuildWars2.BuildCodes --version 2.2.5                
NuGet\Install-Package Hardstuck.GuildWars2.BuildCodes -Version 2.2.5                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Hardstuck.GuildWars2.BuildCodes" Version="2.2.5" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Hardstuck.GuildWars2.BuildCodes --version 2.2.5                
#r "nuget: Hardstuck.GuildWars2.BuildCodes, 2.2.5"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Hardstuck.GuildWars2.BuildCodes as a Cake Addin
#addin nuget:?package=Hardstuck.GuildWars2.BuildCodes&version=2.2.5

// Install Hardstuck.GuildWars2.BuildCodes as a Cake Tool
#tool nuget:?package=Hardstuck.GuildWars2.BuildCodes&version=2.2.5                

Hardstuck BuildCodes V2 - C# 10 implementation

Everything can be directly included with

using Hardstuck.GuildWars2.BuildCodes.V2;

There are multiple ways to obtain a Hardstuck BuildCode Object:

PerProfessionData.ReloadAll();

// From existing build textual codes:
var code1 = TextLoader.LoadBuildCode("CoI___~______A~M~__A_");

// From existing build binary codes:
ReadonlySpan<byte> bytes = SomeArbitrarySource();
var code2 = BinaryLoader.LoadBuildCode(bytes);

// From existing textual in-game chatlinks:
var inGameLink = "[&DQkAAAAARQDcEdwRAAAAACsSAADUEQAAAAAAAAQCAwDUESsSAAAAAAAAAAA=]";
var code3 = TextLoader.LoadOfficialBuildCode(inGameLink);

// From existing binary in-game chatlink data:
var rawInGameBytes = Convert.FromBase64String(inGameLink[2..^1]);
var code4 = BinaryLoader.LoadOfficialBuildCode(rawInGameBytes);

// From an existing player via the official api:
var apiKey = "AD041D99-AEEF...";
var characterName = "Don Joe Was Taken";
var code5 = await APILoader.LoadBuildCode(apiKey, characterName, Kind.PvE);

// From the character currently ingame on the same machine:
var code6 = await APILoader.LoadBuildCodeFromCurrentCharacter(apiKey);

From this Object different kinds of codes can be generated:

// To a textual version of the Hardstuck BuildCode
string hsCode = TextLoader.WriteBuildCode(code);

// To a compressed binary version of the Hardstuck BuildCode
var buffer1 = new byte[500];
int bytesWritten1 = BinaryLoader.WriteBuildCode(code, buffer1);

// Directly to a full in-game chat link
string chatLink = TextLoader.WriteOfficialBuildCode(code);

// To the raw data of an in-game chat link
var buffer2 = new byte[500];
int bytesWritten2 = BinaryLoader.WriteOfficialBuildCode(code, buffer2);

There are multiple overloads available for most of those operations.

Other utility functions available:

boolean     Static.IsTwoHanded(WeaponType weapon);
Tristate    Static.IsAquatic(WeaponType weapon);
WeaponSet   Static.ResolveEffectiveWeapons(BuildCode code, WeaponSetNumber set);
ItemId      Static.ResolveDummyItemForWeaponType(WeaponType weaponType, StatId statId);
ItemId      Static.ResolveDummyItemForEquipment(int equipmentIndex, WeightClass weightClass, StatId statId);
WeightClass Static.ResolveWeightClass(Profession profession);

Task<WeaponType>           APICache.ResolveWeaponType(int itemId);
Task<StatId>               APICache.ResolveStatId(int itemId);
ValueTask<TraitLineChoice> APICache.ResolvePosition(int? traitId);
ValueTask<SkillId>         APICache.ResolveWeaponSkill(BuildCode code, WeaponSet effectiveWeapons, int skillIndex);
Task<TraitId>              APICache.ResolveTrait(Specialization spec, TraitSlot traitSlot);
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
2.2.5 143 9/2/2024
2.2.4 137 7/5/2024
2.2.3 362 11/16/2023
2.2.2 123 11/16/2023
2.2.1 137 11/11/2023