Package me.ramendev.expokert
Class Card
java.lang.Object
me.ramendev.expokert.Card
- Direct Known Subclasses:
Wildcard
A playing card. Playing card Wikipedia article.
This class only contains the basic information about a playing card, which is
its
Pip (its value, synonymously) and its Suit.- API Note:
- Technically, one could create a
Cardwith thePip.WILDpip and theSuit.WILDsuit, thus not implementing the wildcardWildcard.getConversions()functionality one would do by instantiating, aWildcardor its subclass instance. This, obviously, is not recommended. - Implementation Note:
- If you want to create a wildcard-kind of card, you should always use
the abstract class
Wildcard, or one of the wildcard implementations such asJoker.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Card
Creates a card from the given pip and suit.- Parameters:
pip- The pip of the card.suit- The suit of the card.- Throws:
IllegalCardException- When any of the pip or the suit of the card is WILD. It is recommended that you implement aWildcard, or use one of its subclasses instead, such asJoker.
-
Card
Creates a card from the given string, which should notate the card's properties.- Parameters:
string- The string of this card.- Throws:
IllegalCardException- When the string's notation cannot be parsed to a card.
-
-
Method Details