Kunc.RiotGames.Lor.DeckCodes 0.2.3

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
dotnet add package Kunc.RiotGames.Lor.DeckCodes --version 0.2.3
NuGet\Install-Package Kunc.RiotGames.Lor.DeckCodes -Version 0.2.3
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="Kunc.RiotGames.Lor.DeckCodes" Version="0.2.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Kunc.RiotGames.Lor.DeckCodes --version 0.2.3
#r "nuget: Kunc.RiotGames.Lor.DeckCodes, 0.2.3"
#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 Kunc.RiotGames.Lor.DeckCodes as a Cake Addin
#addin nuget:?package=Kunc.RiotGames.Lor.DeckCodes&version=0.2.3

// Install Kunc.RiotGames.Lor.DeckCodes as a Cake Tool
#tool nuget:?package=Kunc.RiotGames.Lor.DeckCodes&version=0.2.3



This is a C# implementation of the C# library RiotGames/LoRDeckCodes. This library is faster and more efficient (at least 50% less memory allocation).


var deck1 = new List<DeckItem>()
    new() { CardCode = "01DE002", Count = 4 },
    new() { CardCode = "02BW003", Count = 2 },
    new() { CardCode = "02BW010", Count = 3 },
var deckEncoder = new LorDeckEncoder();
string code = deckEncoder.GetCodeFromDeck(deck1);
List<DeckCard> deck2 = deckEncoder.GetDeckFromCode<DeckCard>(code);

You can also use your own class, all you have to do is implement 2 interface
IDeckCard - to get deck from code
IReadOnlyDeckCard - to get the code from the deck

class MyCard : IDeckItem, IReadOnlyDeckItem 
    public string CardCode { get; set; }
    public int Count { get; set; }
    // ...
var deckEncoder = new LorDeckEncoder();
List<MyCard> deck = deckEncoder.GetDeckFromCode<MyCard>("SomeCode");
string code = deckEncoder.GetCodeFromDeck(deck);

Build-in DI support

// ...
var deckEncoder = serviceProvider.GetRequiredService<ILorDeckEncoder>();


Kunc.RiotGames.Lor.DeckCodes isn't endorsed by Riot Games and doesn't reflect the views or opinions of Riot Games or anyone officially involved in producing or managing Riot Games properties. Riot Games, and all associated properties are trademarks or registered trademarks of Riot Games, Inc.

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 is compatible.  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 is compatible.  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
0.2.3 128 10/8/2023
0.2.2 233 2/22/2023
0.2.1 362 10/23/2022
0.2.0 355 10/23/2022