Class Deck

public class Deck
extends java.lang.Object

Models a deck of playing cards in a solitaire game.

Field Summary
(package private)  int Current
          the current position in the deck
(package private)  Card[] TheDeck
          Implementation of the deck is an array of cards
 
Constructor Summary
Deck()
          Construct a deck of randomly shuffled cards
 
Method Summary
 Card Deal()
          Deal a card from the deck
 java.lang.String Get()
          Show cards remaining in deck
 boolean Is_Empty()
          Are there any more cards to be dealt?
 void Shuffle()
          Randomly rearrange the items in a one dimensional array
USES: Math.Random()
 int SizeOf()
          gets the size of the current deck
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TheDeck

Card[] TheDeck
Implementation of the deck is an array of cards

Current

int Current
the current position in the deck
Constructor Detail

Deck

public Deck()
Construct a deck of randomly shuffled cards
Method Detail

Deal

public Card Deal()
Deal a card from the deck
Returns:
Card, the next card in the deck

Is_Empty

public boolean Is_Empty()
Are there any more cards to be dealt?

SizeOf

public int SizeOf()
gets the size of the current deck
Returns:
integer number of cards remaining in deck

Get

public java.lang.String Get()
Show cards remaining in deck

Shuffle

public void Shuffle()
Randomly rearrange the items in a one dimensional array
USES: Math.Random()