dotnet add package TehDeck --version 1.0.0
NuGet\Install-Package TehDeck -Version 1.0.0
<PackageReference Include="TehDeck" Version="1.0.0" />
paket add TehDeck --version 1.0.0
#r "nuget: TehDeck, 1.0.0"
// Install TehDeck as a Cake Addin #addin nuget:?package=TehDeck&version=1.0.0 // Install TehDeck as a Cake Tool #tool nuget:?package=TehDeck&version=1.0.0
TehDeck is a .NET API designed to ease the creation of custom Cards and Decks for games.
Creating a custom Card<br>Inherit from
Card class, and override
IsEqualTo(Card) function. It's that simple.
Creating a Deck<br>First, create
CardInfo objects from your
Card objects.<br>Just do a
new CardInfo(card, uniqueCount) to create the object.
uniqueCountmeans how many cards of this type can be in the deck upon creation.<br>A non-positive number signifies it doesn't have a unique count.
Now, bunch them up into a
IList<CardInfo> and pass it to
DeckInfo when creating the object.<br>
DeckInfoconstructor requires an Integer too, signifying how many cards will be in the deck upon creation.
Finally, create a
Deck class, passing in the
DeckInfo object you have created.
Manipulating the deck
<br>You can draw a card with
You can peek the next card in the stack wtih
There are functions for inserting cards into the deck, shuffling the deck and resetting the deck as well.
You can inherit the
Deck class if you wish to add more functionality to your custom Deck of cards.
Check Sample Project for the full source code
// Generate card information first. List<CardInfo> cardInfos = new List<CardInfo>(); // There should only be 1 joker card. cardInfos.Add(new CardInfo(new JokerCard(), 1)); // Fill the rest of the deck with blanks. cardInfos.Add(new CardInfo(new BlankCard())); // The deck will only have 6 cards, populated with the above card information. DeckInfo deckInfo = new DeckInfo(6, cardInfos); // Create the deck. deck = new Deck(deckInfo);```
|.NET||net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows|
- No dependencies.
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.