|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Solitaire | +--heineman.Klondike
Standard Klondike PlugIn.
Layout: Deal seven packets of cards in a row, all face down. The first consists of one card, the second of two, the third of three, and so on to the seventh of seven. Then turn the top card of each packet face up.
Object: To found the four Aces as and when they appear, and to build each one up in suit and sequence to the King.
Play: Turn cards from the deck and play them if possible or else discard them face up to a single wastepile. Exposed cards on the packets are to be packed in descending sequence and alternating color, with their constituent cards spread towards you in columns. A card or properly packed sequence of cards may be transferred from one column to another provided that the join follows the descending-alternating rule. Whenever a down-card is exposed, turn it face up. Whenever a space is made by clearing out a column, fill it only with a King (and any other cards that may be packed upon it in proper sequence). Multiple cards can be moved at once. There is no redeal.
Note: In traditional "solitaire" as we know it in America, three cards are dealt at a time, and any card can be placed on an empty column; so pay attention to the rules above:
Note: As part of the implementation of Klondike, all controllers ensure that a ColumnView object is being dragged; this simplifies some logic, but adds some complexity to the WastePile controller, who manages the PileView object; see WastePileController for details.
Creation date: (11/9/01 9:44:37 PM)
Field Summary | |
static int |
dealCard
Move Types. |
protected Deck |
deck
Each Game has a Deck. |
protected DeckView |
deckView
The view of the deck |
static int |
flipCard
|
protected Pile[] |
foundation
And four Piles as foundation. |
protected PileView[] |
foundationViews
The home locations |
protected BuildablePile |
fromColumnView
When a Card is being dragged, this object references points to the originating ColumnView. |
protected BuildablePileView |
fromPile
Each Game may have cards dragged from BuildablePiles. |
protected PileView |
fromWaste
Each Game may have cards dragged from the WastePile. |
static int |
moveCardToFoundation
|
static int |
moveStack
|
static int |
moveWasteToFoundation
|
protected IntegerView |
numLeftView
View for the number of cards left in the deck. |
protected BuildablePile[] |
piles
And seven BuildablePiles. |
protected BuildablePileView[] |
pileViews
The columns |
protected IntegerView |
scoreView
The display for the score. |
protected java.lang.String |
version
Latest version. |
protected Pile |
wastePile
And a waste pile. |
protected PileView |
wastePileView
The display for the wastePile. |
Constructor Summary | |
Klondike()
Klondike constructor comment. |
Method Summary | |
java.util.Enumeration |
availableMoves()
Return list of available moves. |
java.lang.String |
getName()
getName method comment. |
java.lang.String |
getVersion()
getName method comment. |
boolean |
hasWon()
Return whether the game has been won. |
void |
initialize()
initialize method comment. |
protected void |
initializeControllers()
initialize controllers comment. |
protected void |
initializeModel(int seed)
initialize method comment. |
protected void |
initializeView()
initialize view comment. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Deck deck
protected BuildablePileView fromPile
protected PileView fromWaste
protected BuildablePile[] piles
protected Pile[] foundation
protected java.lang.String version
protected Pile wastePile
protected DeckView deckView
protected BuildablePileView[] pileViews
protected PileView[] foundationViews
protected IntegerView scoreView
protected PileView wastePileView
protected IntegerView numLeftView
protected BuildablePile fromColumnView
public static final int dealCard
public static final int moveCardToFoundation
public static final int moveWasteToFoundation
public static final int moveStack
public static final int flipCard
Constructor Detail |
public Klondike()
Method Detail |
public java.util.Enumeration availableMoves()
public java.lang.String getName()
public java.lang.String getVersion()
public boolean hasWon()
In Klondike, the game is won once the score reaches 52, which means that all thirteen cards of each of the four suits has made it to the foundation.
public void initialize()
protected void initializeControllers()
protected void initializeModel(int seed)
protected void initializeView()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |