Kunc.RiotGames.Lor.DeckCodes
0.4.0
Prefix Reserved
dotnet add package Kunc.RiotGames.Lor.DeckCodes --version 0.4.0
NuGet\Install-Package Kunc.RiotGames.Lor.DeckCodes -Version 0.4.0
<PackageReference Include="Kunc.RiotGames.Lor.DeckCodes" Version="0.4.0" />
paket add Kunc.RiotGames.Lor.DeckCodes --version 0.4.0
#r "nuget: Kunc.RiotGames.Lor.DeckCodes, 0.4.0"
// Install Kunc.RiotGames.Lor.DeckCodes as a Cake Addin #addin nuget:?package=Kunc.RiotGames.Lor.DeckCodes&version=0.4.0 // Install Kunc.RiotGames.Lor.DeckCodes as a Cake Tool #tool nuget:?package=Kunc.RiotGames.Lor.DeckCodes&version=0.4.0
Kunc.RiotGames.Lor.DeckCodes
This is a better implementation of the C# library RiotGames/LoRDeckCodes, which is used to encode/decode Legends of Runeterra decks to/from simple strings. This library is faster and more efficient (at least 50% less memory allocation).
Documentation on how this works can be found in the original repository.
How to Use
using Kunc.RiotGames.Lor.DeckCodes;
var deckEncoder = new LorDeckEncoder();
var deck1 = new List<DeckItem>()
{
new() { CardCode = "01DE002", Count = 4 },
new() { CardCode = "02BW003", Count = 2 },
new() { CardCode = "02BW010", Count = 3 },
...
}
string code = deckEncoder.GetCodeFromDeck(deck1);
List<DeckCard> deck2 = deckEncoder.GetDeckFromCode<DeckCard>(code);
You can also use your own class instead of the DeckItem
, all you have to do is implement these 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);
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 | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | 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. net9.0 is compatible. |
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.