wyvern.lib.classes.games.card
Class Deck

java.lang.Object
  extended bywyvern.lib.classes.games.card.Deck
All Implemented Interfaces:
CardConstants

public class Deck
extends java.lang.Object
implements CardConstants

A deck of 52 playing cards: 4 suits, 13 faces. You can shuffle the deck, deal cards and hands from the deck, etc.

Version:
1.0, Oct 02, 2003
Author:
Steve Yegge

Field Summary
 
Fields inherited from interface wyvern.lib.classes.games.card.CardConstants
ACE, ACE_OF_CLUBS, ACE_OF_DIAMONDS, ACE_OF_HEARTS, ACE_OF_SPADES, CLUBS, DIAMONDS, EIGHT, EIGHT_OF_CLUBS, EIGHT_OF_DIAMONDS, EIGHT_OF_HEARTS, EIGHT_OF_SPADES, FIVE, FIVE_OF_CLUBS, FIVE_OF_DIAMONDS, FIVE_OF_HEARTS, FIVE_OF_SPADES, FLUSH, FOUR, FOUR_OF_A_KIND, FOUR_OF_CLUBS, FOUR_OF_DIAMONDS, FOUR_OF_HEARTS, FOUR_OF_SPADES, FULL_HOUSE, HEARTS, JACK, JACK_OF_CLUBS, JACK_OF_DIAMONDS, JACK_OF_HEARTS, JACK_OF_SPADES, KING, KING_OF_CLUBS, KING_OF_DIAMONDS, KING_OF_HEARTS, KING_OF_SPADES, NINE, NINE_OF_CLUBS, NINE_OF_DIAMONDS, NINE_OF_HEARTS, NINE_OF_SPADES, NOTHING, NUM_CARDS, NUM_FACES, NUM_SUITS, ONE_PAIR, QUEEN, QUEEN_OF_CLUBS, QUEEN_OF_DIAMONDS, QUEEN_OF_HEARTS, QUEEN_OF_SPADES, ROYAL_FLUSH, SEVEN, SEVEN_OF_CLUBS, SEVEN_OF_DIAMONDS, SEVEN_OF_HEARTS, SEVEN_OF_SPADES, SIX, SIX_OF_CLUBS, SIX_OF_DIAMONDS, SIX_OF_HEARTS, SIX_OF_SPADES, SPADES, STRAIGHT, STRAIGHT_FLUSH, TEN, TEN_OF_CLUBS, TEN_OF_DIAMONDS, TEN_OF_HEARTS, TEN_OF_SPADES, THREE, THREE_OF_A_KIND, THREE_OF_CLUBS, THREE_OF_DIAMONDS, THREE_OF_HEARTS, THREE_OF_SPADES, TWO, TWO_OF_CLUBS, TWO_OF_DIAMONDS, TWO_OF_HEARTS, TWO_OF_SPADES, TWO_PAIR
 
Constructor Summary
Deck()
          Constructs a new Deck.
 
Method Summary
 int random(int min, int max)
          Returns a random number between min and max, inclusive.
 void shuffle()
          Shuffles the deck.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Deck

public Deck()
Constructs a new Deck.

Method Detail

shuffle

public void shuffle()
Shuffles the deck.


random

public int random(int min,
                  int max)
Returns a random number between min and max, inclusive.

Parameters:
min - the lower bound
max - the upper bound
Returns:
a random number between min and max, inclusive