com.asdf.plugins.pokergames
Class Deck

java.lang.Object
  extended by com.asdf.plugins.pokergames.Deck

public class Deck
extends java.lang.Object

Represents a traditional 52 card deck with no jokers.

Author:
urtela

Field Summary
static int NUM_CARDS
           
static int[] primes
           
 
Constructor Summary
Deck()
          Default constructor.
 
Method Summary
 Card dealCard()
          Removes the bottom card from the deck.
 void extractCard(Card c)
          Extracts known card from the deck.
 void extractHand(Hand h)
          Extracts known cards from the deck.
 Card getCard(int index)
          Gets the card in the given index.
 int getNumberOfCards()
          Getter method of the size
 void newDeck()
          Initialises this deck into a randomised 52 card deck.
 void shuffle()
          Shuffles the deck.
 java.lang.String toString()
          Gives a string representation of the deck.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

primes

public static int[] primes

NUM_CARDS

public static final int NUM_CARDS
See Also:
Constant Field Values
Constructor Detail

Deck

public Deck()
Default constructor. Initialises the deck into a randomised 52 card deck. No jokers.

Method Detail

newDeck

public void newDeck()
Initialises this deck into a randomised 52 card deck. No jokers. Removes any possible information the deck might previously contain.


shuffle

public void shuffle()
Shuffles the deck.


dealCard

public Card dealCard()
Removes the bottom card from the deck.

Returns:
The bottom card of the deck.

extractCard

public void extractCard(Card c)
Extracts known card from the deck.


extractHand

public void extractHand(Hand h)
Extracts known cards from the deck.


getCard

public Card getCard(int index)
Gets the card in the given index.

Parameters:
index -
Returns:
The card in the given index:

getNumberOfCards

public int getNumberOfCards()
Getter method of the size

Returns:
The size of the deck.

toString

public java.lang.String toString()
Gives a string representation of the deck.

Overrides:
toString in class java.lang.Object