-footer

Package garrettsmith.playingcards

Provides basic classes for simulating a game that uses playing cards.

See:
          Description

Interface Summary
Deck Abstractly represents a deck of playing cards with a type distribution.
 

Class Summary
Card Represents a card in a typical deck of playing cards.
Card.Color Represents the card's color: red, black, or none.
Card.Suit Represents a card's suit, such as spades or clubs.
Card.Value Represents a card's value: two, queen, or ace, for example.
CardContainer Represents a collection of cards, typically comprised of one or more decks.
CardList Provides a List with some protection to ensure only Card objects are put into the list.
StandardDeck Represents a standard deck of 52 playing cards.
 

Exception Summary
NoMoreCardsException Thrown when a card is requested from a collection but that collection has no more cards left.
 

Package garrettsmith.playingcards Description

Provides basic classes for simulating a game that uses playing cards.

While Plaingcards was designed to be flexible enough to support any card game, it was implemented only with the features needed to simulate a game of Blackjack. For example, the package provides only minimal support for jokers because Blackjack does not require them.

Card is an immutable object that represents a single card. CardContainer and CardList types provide logical aggregations of cards.

Deck provides for an arbitrary type distribution of cards. Blackjack requires a standard deck of cards with no jokers. Some types of poker use jokers. Pinochle, for example, uses an altogether different type of deck. If you require a different type of deck, provide a new Deck implementation and use it with CardContainer.

CardContainer provides for shuffling and distributing an arbitrary type distribution and number of decks.


-footer

Copyright 2001-5 Garrett Smith. Use is subject to license terms.