Kunc.RiotGames.Lor.DeckCodes 0.2.0

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Kunc.RiotGames.Lor.DeckCodes --version 0.2.0                
NuGet\Install-Package Kunc.RiotGames.Lor.DeckCodes -Version 0.2.0                
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.0" />                
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.0                
#r "nuget: Kunc.RiotGames.Lor.DeckCodes, 0.2.0"                
#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.0

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

Kunc.RiotGames.Lor.DeckCodes

Nuget

This is a C# implementation of the C# library RiotGames/LoRDeckCodes. This library is faster and allocate less memory.

Usage

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

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

Disclaimer

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 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
0.3.1 106 6/28/2024
0.3.0 105 6/2/2024
0.2.3 163 10/8/2023
0.2.2 263 2/22/2023
0.2.1 387 10/23/2022
0.2.0 380 10/23/2022

Added default extension method for IServiceCollection.