Innobate.CardDeck.Cards 0.0.9-alpha

This is a prerelease version of Innobate.CardDeck.Cards.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Innobate.CardDeck.Cards --version 0.0.9-alpha
NuGet\Install-Package Innobate.CardDeck.Cards -Version 0.0.9-alpha
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="Innobate.CardDeck.Cards" Version="0.0.9-alpha" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Innobate.CardDeck.Cards --version 0.0.9-alpha
#r "nuget: Innobate.CardDeck.Cards, 0.0.9-alpha"
#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 Innobate.CardDeck.Cards as a Cake Addin
#addin nuget:?package=Innobate.CardDeck.Cards&version=0.0.9-alpha&prerelease

// Install Innobate.CardDeck.Cards as a Cake Tool
#tool nuget:?package=Innobate.CardDeck.Cards&version=0.0.9-alpha&prerelease

Spanish-Suited Playing Cards CardDeck-Cards

A standard Spanish-suited pack of playing cards consists of 48 cards, divided into four suits:

  • Espadas (swords)
  • Bastos (clubs)
  • Copas (cups)
  • Oros (coins)

Each suit contains 12 cards: ace (as), king, knight (caballero), jack (sota), and 2-7. The 8-9 cards are usually removed due to a rise in popularity of games only involving 40 cards to play.

Court Card Ranking

The court cards are ranked as follows:

  1. King (rey)
  2. Knight (caballero)
  3. Jack (sota)

The other cards are ranked in numerical order, with the ace being the highest card.

Usage

Spanish-suited playing cards are commonly used in the following regions:

  • Spain
  • Portugal
  • Many parts of Latin America
  • The Philippines

They are also used in some parts of France and Italy.

Note

Some Spanish-suited packs may include two jokers, which are not assigned to any suit.

Example

Here is an example of a standard Spanish-suited pack of playing cards:

Suit Ace King Knight Jack 2 3 4 5 6 7
Espadas A♠ K♠ Q♠ J♠ 2♠ 3♠ 4♠ 5♠ 6♠ 7♠
Bastos A♣ K♣ Q♣ J♣ 2♣ 3♣ 4♣ 5♣ 6♣ 7♣
Copas A♥ K♥ Q♥ J♥ 2♥ 3♥ 4♥ 5♥ 6♥ 7♥
Oros A♦ K♦ Q♦ J♦ 2♦ 3♦ 4♦ 5♦ 6♦ 7♦

Espadas (Swords): E1, E2, E3, E4, E5, E6, E7, E8, E9, ES, EC, ER

Copas (Cups): C1, C2, C3, C4, C5, C6, C7, C8, C9, CS, CC, CR

Oros (Coins): O1, O2, O3, O4, O5, O6, O7, O8, O9, OS, OC, OR

Bastos (Clubs): B1, B2, B3, B4, B5, B6, B7, B8, B9, BS, BC, BR

Additional Information

  • Spanish Name: Spanish cards are called naipes españoles in Spanish. They are also sometimes referred to as baraja española (Spanish deck) or cartas de baraja (playing cards).

  • Differences from French Cards: Spanish cards are different from French-suited playing cards in a few ways. First, they have different suits: espadas (swords), bastos (clubs), copas (cups), and oros (coins). Second, they have different court cards: rey (king), caballo (knight), and sota (jack). Third, they have a different ranking system: the ace is the highest card in each suit, followed by the rey, caballo, and sota.

  • Usage in Card Games: Spanish cards are used in a variety of card games, including chinchón, brisca, and mus. They are also used in fortune telling and other divination practices.

Names in English and Spanish

Here is a table of the different names for Spanish cards in English and Spanish:

English Spanish
Ace As
King Rey
Knight Caballo
Jack Sota
Clubs Bastos
Cups Copas
Swords Espadas
Coins Oros

CardDeck.Cards.Spanish

The CardDeck.Cards.Spanish library is a component of the CardDeck library that allows developers to create custom cards for use with the CardDeck library's Deck class. These custom cards are designed to enable the creation of customized card decks tailored for specific card games or applications. While the provided code is specific to Spanish-suited playing cards, developers can adapt it to create cards for other card types.

Key Features of the CardDeck.Cards.Spanish Library:

  • Custom Card Implementation: The library provides a simple and extensible implementation for creating custom Spanish-suited playing cards. Developers can customize the suit and face values of the cards to match their specific requirements.

  • Unicode Symbols for Suits: The library includes Unicode symbols for representing the four Spanish suits: Espadas (Swords), Bastos (Clubs), Copas (Cups), and Oros (Coins). These symbols can be used to display the suits of the cards.

  • Face Values: The library defines face values for Spanish-suited cards, including Ace, King, Knight, Jack, and numeric values from 2 to 7.

  • Card Representation: Each card is represented by a combination of its suit and face value, and a short code is generated based on these values. For example, "3♠" represents the 3 of Espadas (Swords).

  • Joker Card Support: The library includes support for Joker cards with customizable values.

  • Full Card Values: In addition to standard face values, the library also provides full card values that include Eight and Nine.

Developers can use this library to create their own custom card types for various card games and applications. The provided code serves as a starting point for implementing Spanish-suited cards, and similar approaches can be applied to other types of playing cards.

The CardDeck.Cards.Spanish library can be used in conjunction with the CardDeck library to create and manage custom card decks for a wide range of card-based applications.

German-Suited Playing Cards

CardDeck-Cards: card-suits.png

A standard German-suited pack of playing cards consists of 32 or 36 cards, divided into four suits:

  • Eichel (acorns)
  • Grün (leaves)
  • Herz (hearts)
  • Schelle (bells)

Each suit contains 8 or 9 cards: Unter (under), Ober (over), König (king), and 6-10.

Court Card Ranking

The court cards are ranked as follows:

  1. Unter (Under or Jack)
  2. Ober (Over)
  3. König (king)

The other cards are ranked in numerical order, with the 10 being the highest card.

Usage

German-suited playing cards are commonly used in the following regions:

  • Germany
  • Austria
  • Switzerland
  • Liechtenstein
  • Parts of Belgium
  • Parts of the Netherlands
  • Parts of the Czech Republic
  • Parts of Slovakia
  • Parts of Hungary

Note

Some German-suited packs may include one or two jokers, which are not assigned to any suit.

###Example

Here is an example of a standard German-suited pack of playing cards: | Suit | Unter | Ober | König | 10 | 9 | 8 | 7 | 6 | | ------- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | | Eichel | U♠ | O♠ | K♠ | 10♠ | 9♠ | 8♠ | 7♠ | 6♠ | | Grün | U♣ | O♣ | K♣ | 10♣ | 9♣ | 8♣ | 7♣ | 6♣ | | Herz | U♥ | O♥ | K♥ | 10♥ | 9♥ | 8♥ | 7♥ | 6♥ | | Schelle | U♦ | O♦ | K♦ | 10♦ | 9♦ | 8♦ | 7♦ | 6♦ |

Eichel (Acorns): E7, E8, E9, E10, EU, EO, EK, EA

Grün (Leaves): G7, G8, G9, G10, GU, GO, GK, GA

Herz (Hearts): H7, H8, H9, H10, HU, HO, HK, HA

Schellen (Bells): S7, S8, S9, S10, SU, SO, SK, SA

Additional Information

  • German Name: German cards are called deutsche Spielkarten in German. They are also sometimes referred to as Spielkarten (playing cards) or Kartendeck (deck of cards).

  • Differences from French Cards: German cards are different from French-suited playing cards in a few ways. First, they have different suits: Eichel (acorns), Grün (leaves), Herz (hearts), and Schelle (bells). Second, they have different court cards: Ober (over), Unter (under), and König (king). Third, they have a different ranking system: the 10 is the highest card in each suit, followed by the König, Ober, and Unter.

  • Usage in Card Games: German cards are used in a variety of card games, including Skat, Doppelkopf, Schafkopf, and Cego. They are also sometimes used to play tarot games, such as Bavarian Tarock and Swiss Tarock.

Names in English and German

Here is a table of the different names for German cards in English and German:

English German
Unter Unter
Ober Ober
König König
10 Zehn
9 Neun
8 Acht
7 Sieben
6 Sechs
Clubs Grün
Cups Herz
Swords Eichel
Coins Schelle

CardDeck.Cards.German

To create a German Suited Deck of playing cards using the CardDeck.Cards.German namespace, you can follow these steps:

  1. Create a new instance of the GermanDeckFactory<TCard, TJokerCard> class, where TCard is the type of card that you want to use in your deck and TJokerCard is the type of joker card that you want to use in your deck.
  2. Call the InitialiseCards() method on the deck factory, passing in the following parameters:
    • The deck that you want to initialise.
    • A boolean value indicating whether or not to include joker cards in the deck.
    • The number of joker cards to include in the deck (if includeJokers is true).

The InitialiseCards() method will add the following cards to the deck:

  • Four of each suit (Herz, Karo, Kreuz, and Pik) for the standard card values (Ass, Sieben, Acht, Neun, Zehn, Unter, Ober, and König).
  • Two joker cards (if includeJokers is true).

Here is an example of how to create a German Suited Deck of playing cards using the CardDeck.Cards.German namespace:

using CardDeck.Cards.German;
using CardDeck.Factories;

// Create a new German deck factory.
var deckFactory = new GermanDeckFactory<StandardCard<GermanCard.CardSuit, GermanCard.CardValue>, JokerCard<GermanCard.CardSuit, GermanCard.CardValue>>();

// Create a new deck and initialise it with joker cards.
var deck = new Deck<StandardCard<GermanCard.CardSuit, GermanCard.CardValue>, JokerCard<GermanCard.CardSuit, GermanCard.CardValue>>();
deckFactory.InitialiseCards(deck, includeJokers: true);

Once you have created a German Suited Deck of playing cards, you can use it to play a variety of card games, such as Skat, Doppelkopf, and Schafkopf.

Feature: Retrieve card value enums based on search criteria in ValueRetriever<TValue>

This feature allows users to retrieve a list of card value enums based on a variety of search criteria, including name, English name, symbol, and alternative symbol, in the ValueRetriever<TValue> class.

Benefits:

  • This feature makes it easier to find the card value enum that you are looking for, especially if you do not know the exact name or symbol.
  • This feature can be used to create more powerful and flexible card game applications.

Implementation:

  • Four new methods were added to the ValueRetriever<TValue> class:

    • GetCardEnumValuesByName()
    • GetCardEnumValuesByEnglishName()
    • GetCardEnumValuesBySymbol()
    • GetCardEnumValuesByAlternativeSymbol()
  • These methods use reflection to iterate over the enum values and get the ValueInfo object for each enum value.

  • The ValueInfo object contains information about the enum value, such as the name, English name, symbol, and alternative symbol.

  • The methods then filter the enum values based on the search criteria and return a list of the matching enum values.

Usage:

  • To use the new methods, simply create a new instance of the ValueRetriever<TValue> class and call the appropriate method.
  • The method will return a list of the matching enum values.

Example:

//Create a card value enum type
    public enum CardValueEnum
    {
        [Description("{\r\n    \"Name\": \"Joker\",\r\n    \"EnglishName\": \"Joker\",\r\n    \"IsJoker\": true\r\n}")]
        Joker,

        [Description("{\r\n    \"Name\": \"Ace\",\r\n    \"EnglishName\": \"Ace\",\r\n    \"IsAceCard\": true\r\n}")]
        Ace = 1,
    }

// Create a new instance of the ValueRetriever<TValue> class. var valueRetriever = new ValueRetriever<CardValueEnum>();

// Get a list of all card value enums with the name "Ace". var aces = valueRetriever.GetCardEnumValuesByName("Ace");

// Get a list of all card value enums with the symbol "A". var acesWithASymbol = valueRetriever.GetCardEnumValuesBySymbol("A");

Attribuition

<a href="https://www.flaticon.com/free-icons/playing-cards" title="playing cards icons">Playing cards icons created by Freepik - Flaticon</a>

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 (1)

Showing the top 1 NuGet packages that depend on Innobate.CardDeck.Cards:

Package Downloads
Innobate.CardDeck.Factories

CardDeck Factories: A library of versatile deck factory classes for creating and initializing card decks tailored to various card games. Includes factories for Bezique, Euchre, Standard Spanish, Pinochle, Piquet, and Full Spanish decks, providing developers with the tools to easily generate custom card decks for their applications and card games

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.0.11-alpha 168 11/16/2023
0.0.10-alpha 60 11/15/2023
0.0.9-alpha 56 11/13/2023
0.0.8-alpha 60 11/10/2023
0.0.7-alpha 51 11/7/2023
0.0.6-alpha 51 11/7/2023
0.0.1-alpha5 59 11/7/2023
0.0.1-alpha4 61 11/6/2023
0.0.1-alpha3 59 11/6/2023
0.0.1-alpha2 58 11/5/2023