Class Shoe

java.lang.Object
  |
  +--Shoe

public class Shoe
extends Object

Models a Blackjack Shoe

Author:
Mike Scott

Constructor Summary
Shoe()
          pre: none post: create a SHOE with 6 decks, shuffle it, and pick the reset point
Shoe(int numDecks)
          pre: 0 < numDecks post: create a SHOE with numDecks decks, shuffle it, and pick the reset point
 
Method Summary
 Card deal()
          pre: !isEmpty()
post: return the top card of the Shoe.
 boolean mustShuffle()
          pre: none
post: return true if the Shoe needs to be shuffled
 int numCards()
          pre: none
post: return the number of cards left in the shoe
 int numCardsToShuffle()
          pre: none
post: return the number of cards until the Shoe must be shuffled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Shoe

public Shoe()
pre: none post: create a SHOE with 6 decks, shuffle it, and pick the reset point


Shoe

public Shoe(int numDecks)
pre: 0 < numDecks post: create a SHOE with numDecks decks, shuffle it, and pick the reset point

Method Detail

deal

public Card deal()
pre: !isEmpty()
post: return the top card of the Shoe. numCards() = old numCards - 1 if numCardsToShuffle = 0 then mustShuffle() = true


mustShuffle

public boolean mustShuffle()
pre: none
post: return true if the Shoe needs to be shuffled


numCards

public int numCards()
pre: none
post: return the number of cards left in the shoe


numCardsToShuffle

public int numCardsToShuffle()
pre: none
post: return the number of cards until the Shoe must be shuffled



Generated by BlueJ