org.vizzini.game.cardgame
Class PokerDeck

java.lang.Object
  extended by org.vizzini.util.AbstractCollection
      extended by org.vizzini.util.AbstractMap
          extended by org.vizzini.game.TokenCollection
              extended by org.vizzini.game.cardgame.CardCollection
                  extended by org.vizzini.game.cardgame.PokerDeck
All Implemented Interfaces:
PropertyChangeListener, Serializable, Cloneable, Iterable, Collection, EventListener, ICardCollection, ITokenCollection, ICollection

public class PokerDeck
extends CardCollection

Provides a poker card deck for card games in the game framework.

Since:
v0.1
Version:
v0.3
Author:
Jeffrey M. Thompson
See Also:
Serialized Form

Field Summary
static ISuit CLUBS
          Clubs suit.
static ISuit DIAMONDS
          Diamonds suit.
static ISuit HEARTS
          Hearts suit.
static ISuit SPADES
          Spades suit.
static ISuit[] SUITS
          Array of suits.
 
Constructor Summary
  PokerDeck()
          Construct this object with 52 cards.
  PokerDeck(boolean isUsingJokers)
          Construct this object using the given parameter.
protected PokerDeck(int numCards)
          Construct this object using the given parameter.
 
Method Summary
protected  void init(int numCards)
          Initialize the deck with the standard cards.
protected  void initCard(String name, int value, ISuit suit)
          Create and add a card with the given parameters.
protected  void initCards(String name, int value)
          Create cards for each suit with the given parameters.
 boolean isUsingJokers()
          Return true if Jokers are included.
 void reset()
          Reset this deck.
 
Methods inherited from class org.vizzini.game.cardgame.CardCollection
get, get, getFirst, getFlushes, getKey, getKey, getKinds, getLast, getStraights, getType, propertyChange, removeFirst, removeLast, shuffle, sort
 
Methods inherited from class org.vizzini.game.TokenCollection
add, clone, configure, configure, findByName, get, get, getData, getKey, getTokenPropertyNames, iterator, remove
 
Methods inherited from class org.vizzini.util.AbstractMap
clear, contains, equals, hashCode, isEmpty, iterator, size, toString
 
Methods inherited from class org.vizzini.util.AbstractCollection
addAll, containsAll, removeAll, retainAll, toArray, toArray
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.vizzini.game.ITokenCollection
clone, configure, findByName, get, get, iterator
 
Methods inherited from interface org.vizzini.util.ICollection
toString
 
Methods inherited from interface java.util.Collection
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 

Field Detail

CLUBS

public static final ISuit CLUBS
Clubs suit.


HEARTS

public static final ISuit HEARTS
Hearts suit.


SPADES

public static final ISuit SPADES
Spades suit.


DIAMONDS

public static final ISuit DIAMONDS
Diamonds suit.


SUITS

public static final ISuit[] SUITS
Array of suits.

Constructor Detail

PokerDeck

public PokerDeck()
Construct this object with 52 cards.

Since:
v0.1

PokerDeck

public PokerDeck(boolean isUsingJokers)
Construct this object using the given parameter.

Parameters:
isUsingJokers - Flag indicating whether to include Jokers in the deck.
Since:
v0.1

PokerDeck

protected PokerDeck(int numCards)
Construct this object using the given parameter.

Since:
v0.1
Method Detail

isUsingJokers

public boolean isUsingJokers()
Return true if Jokers are included.

Since:
v0.1

reset

public void reset()
Reset this deck.

Since:
v0.1

init

protected void init(int numCards)
Initialize the deck with the standard cards.

Since:
v0.1

initCard

protected void initCard(String name,
                        int value,
                        ISuit suit)
Create and add a card with the given parameters.

Since:
v0.1

initCards

protected void initCards(String name,
                         int value)
Create cards for each suit with the given parameters.

Since:
v0.1


Copyright © 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02