Innobate.CardDeck.Factories
0.0.2-alpha
See the version list below for details.
dotnet add package Innobate.CardDeck.Factories --version 0.0.2-alpha
NuGet\Install-Package Innobate.CardDeck.Factories -Version 0.0.2-alpha
<PackageReference Include="Innobate.CardDeck.Factories" Version="0.0.2-alpha" />
paket add Innobate.CardDeck.Factories --version 0.0.2-alpha
#r "nuget: Innobate.CardDeck.Factories, 0.0.2-alpha"
// Install Innobate.CardDeck.Factories as a Cake Addin #addin nuget:?package=Innobate.CardDeck.Factories&version=0.0.2-alpha&prerelease // Install Innobate.CardDeck.Factories as a Cake Tool #tool nuget:?package=Innobate.CardDeck.Factories&version=0.0.2-alpha&prerelease
CardDeck Factories
CardDeck Factories Overview and Quick Guide
The CardDeck library includes several deck factories in the CardDeck.Factories
namespace, each designed to create different types of card decks. This overview and quick guide provides an introduction to six specific deck factories: Bezique, Euchre, Standard Spanish, Pinochle, Piquet and Full Spanish.
Bezique Deck Factory
The Bezique Deck Factory (BeziqueDeckFactory
) is designed for creating decks suitable for the card game Bezique. Here's a quick guide to using this factory:
- Deck Type: Bezique.
- Deck Size: 32 cards (standard Bezique deck size).
- Cards in a Standard Suit: 8 cards (suits: Hearts, Diamonds, Spades, and Clubs).
- Number of Suits in Deck: 4 (Hearts, Diamonds, Spades, and Clubs).
Factory Methods:
CreateCard(int suit, int value)
: Create a card for the given suit and value.CreateJokerCard(int suit, int value)
: Create a joker card for the given suit and value.CreateJokerCard(int suit, int value, JokerType type)
: Create a joker card with a specific type.InitialiseCards(Deck<TCard, TJokerCard> deck, bool includeJokers = false, int jokerQuantity = 2)
: Initialize the cards in the deck.getDeckType()
: Get the deck type ("Bezique").
Euchre Deck Factory
The Euchre Deck Factory (EuchreDeckFactory
) is tailored for creating decks suitable for the card game Euchre. Here's a quick guide to using this factory:
- Deck Type: Euchre.
- Deck Size: 24 cards (standard Euchre deck size).
- Cards in a Standard Suit: 6 cards (suits: Hearts, Diamonds, Spades, and Clubs).
- Number of Suits in Deck: 4 (Hearts, Diamonds, Spades, and Clubs).
Factory Methods:
CreateCard(int suit, int value)
: Create a card for the given suit and value.CreateJokerCard(int suit, int value)
: Create a joker card for the given suit and value.CreateJokerCard(int suit, int value, JokerType type)
: Create a joker card with a specific type.InitialiseCards(Deck<TCard, TJokerCard> deck, bool includeJokers = false, int jokerQuantity = 1)
: Initialize the cards in the deck.getDeckType()
: Get the deck type ("Euchre").
Spanish Deck Factory
The Spanish Deck Factory (SpanishDeckFactory
) is intended for creating decks adhering to the standard Spanish-suited playing cards. Here's a quick guide to using this factory:
- Deck Type: Standard Spanish.
- Deck Size: 40 cards (standard Spanish deck size).
- Cards in a Standard Suit: 10 cards (suits: Espadas, Bastos, Copas, and Oros).
- Number of Suits in Deck: 4 (Espadas, Bastos, Copas, and Oros).
Factory Methods:
CreateCard(int suit, int value)
: Create a card for the given suit and value.CreateJokerCard(int suit, int value)
: Create a joker card for the given suit and value.CreateJokerCard(int suit, int value, JokerType type)
: Create a joker card with a specific type.InitialiseCards(Deck<TCard, TJokerCard> deck, bool includeJokers = false, int jokerQuantity = 2)
: Initialize the cards in the deck.getDeckType()
: Get the deck type ("Standard Spanish").
Pinochle Deck Factory
The Pinochle Deck Factory (PinochleDeckFactory
) is designed for creating decks suitable for the card game Pinochle. Here's a quick guide to using this factory:
- Deck Type: Pinochle - French US.
- Deck Size: 48 cards (standard Pinochle deck size).
- Cards in a Standard Suit: 12 cards (suits: Hearts, Diamonds, Spades, and Clubs).
- Number of Suits in Deck: 4 (Hearts, Diamonds, Spades, and Clubs).
Factory Methods:
CreateCard(int suit, int value)
: Create a card for the given suit and value.CreateJokerCard(int suit, int value)
: Create a joker card for the given suit and value.CreateJokerCard(int suit, int value, JokerType type)
: Create a joker card with a specific type.InitialiseCards(Deck<TCard, TJokerCard> deck, bool includeJokers = false, int jokerQuantity = 2)
: Initialize the cards in the deck.getDeckType()
: Get the deck type ("Pinochle - French US").
Piquet Deck Factory
The Piquet Deck Factory (PiquetDeckFactory
) is tailored for creating decks suitable for the card game Piquet. Here's a quick guide to using this factory:
- Deck Type: Piquet.
- Deck Size: 32 cards (standard Piquet deck size).
- Cards in a Standard Suit: 8 cards (suits: Hearts, Diamonds, Spades, and Clubs).
- Number of Suits in Deck: 4 (Hearts, Diamonds, Spades, and Clubs).
Factory Methods:
CreateCard(int suit, int value)
: Create a card for the given suit and value.CreateJokerCard(int suit, int value)
: Create a joker card for the given suit and value.CreateJokerCard(int suit, int value, JokerType type)
: Create a joker card with a specific type.InitialiseCards(Deck<TCard, TJokerCard> deck, bool includeJokers = false, int jokerQuantity = 2)
: Initialize the cards in the deck.getDeckType()
: Get the deck type ("Piquet").
Spanish Full Deck Factory
The Spanish Full Deck Factory (SpanishFullDeckFactory
) is intended for creating decks adhering to the full Spanish-suited playing cards, including full card values. Here's a quick guide to using this factory:
- Deck Type: Full Spanish.
- Deck Size: 48 cards (standard full Spanish deck size).
- Cards in a Standard Suit: 12 cards (suits: Espadas, Bastos, Copas, and Oros).
- Number of Suits in Deck: 4 (Espadas, Bastos, Copas, and Oros).
Factory Methods:
CreateCard(int suit, int value)
: Create a card for the given suit and value.CreateJokerCard(int suit, int value)
: Create a joker card for the given suit and value.CreateJokerCard(int suit, int value, JokerType type)
: Create a joker card with a specific type.InitialiseCards(Deck<TCard, TJokerCard> deck, bool includeJokers = false, int jokerQuantity = 2)
: Initialize the cards in the deck.getDeckType()
: Get the deck type ("Full Spanish").
These deck factories provide a convenient way to create and initialize decks for different card games. You can select the appropriate factory based on the requirements of your card game and use the provided methods to create and configure your decks.
Example
An example in C# of how to use the different deck factories to create decks of cards for various types:
using CardDeck.Cards;
using CardDeck.Factories;
class Program
{
static void Main()
{
// Create a Bezique deck
IDeckFactory<Card, JokerCard> beziqueFactory = new BeziqueDeckFactory<Card, JokerCard>();
Deck<Card, JokerCard> beziqueDeck = new Deck<Card, JokerCard>(beziqueFactory);
beziqueFactory.InitialiseCards(beziqueDeck, includeJokers: true, jokerQuantity: 2);
// Create an Euchre deck
IDeckFactory<Card, JokerCard> euchreFactory = new EuchreDeckFactory<Card, JokerCard>();
Deck<Card, JokerCard> euchreDeck = new Deck<Card, JokerCard>(euchreFactory);
euchreFactory.InitialiseCards(euchreDeck, includeJokers: true, jokerQuantity: 1);
// Create a Spanish Full deck
IDeckFactory<SpanishCard, SpanishJokerCard> spanishFullFactory = new SpanishFullDeckFactory<SpanishCard, SpanishJokerCard>();
Deck<SpanishCard, SpanishJokerCard> spanishFullDeck = new Deck<SpanishCard, SpanishJokerCard>(spanishFullFactory);
spanishFullFactory.InitialiseCards(spanishFullDeck, includeJokers: true, jokerQuantity: 2);
// Create a Pinochle deck
IDeckFactory<Card, JokerCard> pinochleFactory = new PinochleDeckFactory<Card, JokerCard>();
Deck<Card, JokerCard> pinochleDeck = new Deck<Card, JokerCard>(pinochleFactory);
pinochleFactory.InitialiseCards(pinochleDeck, includeJokers: true, jokerQuantity: 2);
// Create a Piquet deck
IDeckFactory<Card, JokerCard> piquetFactory = new PiquetDeckFactory<Card, JokerCard>();
Deck<Card, JokerCard> piquetDeck = new Deck<Card, JokerCard>(piquetFactory);
piquetFactory.InitialiseCards(piquetDeck, includeJokers: true, jokerQuantity: 2);
// You now have decks of different types ready to be used in card games!
}
}
Attribution
<a href="https://www.flaticon.com/free-icons/card-deck" title="card deck icons">Card deck icons created by ArtBit - Flaticon</a>
Product | Versions 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. |
-
net6.0
- Innobate.CardDeck (>= 0.0.2-alpha)
- Innobate.CardDeck.Cards (>= 0.0.1-alpha2)
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.0.11-alpha | 185 | 11/16/2023 | |
0.0.10-alpha | 72 | 11/15/2023 | |
0.0.9-alpha | 72 | 11/13/2023 | |
0.0.8-alpha | 68 | 11/13/2023 | |
0.0.7-alpha | 71 | 11/7/2023 | |
0.0.6-alpha | 72 | 11/7/2023 | |
0.0.5-alpha | 85 | 11/7/2023 | |
0.0.4-alpha | 84 | 11/6/2023 | |
0.0.3-alpha | 90 | 11/6/2023 | |
0.0.2-alpha | 83 | 11/6/2023 | |
0.0.1-alpha2 | 82 | 11/6/2023 | |
0.0.1-alpha | 85 | 11/5/2023 |