org.ninm.games.cardgames.common
Class DefaultDeck

java.lang.Object
  |
  +--org.ninm.games.cardgames.common.DefaultDeck
All Implemented Interfaces:
Deck

public class DefaultDeck
extends java.lang.Object
implements Deck

This class implements a standard 54 card deck (contains two jokers)

Version:
1.0
Author:
Nikolay

Field Summary
private  java.lang.Object[] m_deckIDs
           
private  java.util.List m_state
           
 
Constructor Summary
DefaultDeck()
           
DefaultDeck(Face[] faces, java.lang.Object deckID)
           
DefaultDeck(Face[] faces, Suit[] suits, java.lang.Object[] deckIDs, int numberOfJokersPerDeck)
           
DefaultDeck(java.lang.Object deckID)
           
 
Method Summary
 Card dealCard()
          randomly removes a card from the deck and deals it out
 void returnCard(Card card)
          returns the card to the deck
 int size()
          returns the number of cards left in the deck
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_state

private final java.util.List m_state

m_deckIDs

private final java.lang.Object[] m_deckIDs
Constructor Detail

DefaultDeck

public DefaultDeck()

DefaultDeck

public DefaultDeck(java.lang.Object deckID)

DefaultDeck

public DefaultDeck(Face[] faces,
                   java.lang.Object deckID)

DefaultDeck

public DefaultDeck(Face[] faces,
                   Suit[] suits,
                   java.lang.Object[] deckIDs,
                   int numberOfJokersPerDeck)
Method Detail

dealCard

public Card dealCard()
Description copied from interface: Deck
randomly removes a card from the deck and deals it out

Specified by:
dealCard in interface Deck
Returns:
Card

size

public int size()
Description copied from interface: Deck
returns the number of cards left in the deck

Specified by:
size in interface Deck
Returns:
int the number of cards left in the deck

returnCard

public void returnCard(Card card)
Description copied from interface: Deck
returns the card to the deck

Specified by:
returnCard in interface Deck
Parameters:
card - the card to be returned to the deck

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

SourceForge.net Logo