brlandry
Class GrandfatherClock

java.lang.Object
  |
  +--Solitaire
        |
        +--brlandry.GrandfatherClock

public class GrandfatherClock
extends Solitaire

Grandfather's Clock:

This game requires a 1024x768 monitor

Foundations (12 piles: the "Clock". Complete these piles to win the game)

Base Cards
12: 9 clubs
1: 10 hearts
2: Jack spades
3: Queen diamonds
4: King clubs
5: 2 hearts
6: 3 spades
7: 4 diamonds
8: 5 clubs
9: 6 hearts
10: 7 spades
11: 8 diamonds

Build up in suit from the base card until the top card of each foundation shows the number corresponding to its position on a clock face (the "hour" in a clock in that position). For example, the 3 of spades at the bottom would build up to the 6 of spades (6 o'clock).

Jack equals 11 o'clock and Queen equals 12 o'clock.

Ranking of cards is continuous: build Aces after Kings when necessary.

All the piles will require 3 cards, except the Ten, Jack, Queen and King, which will require 4 cards each.

Tableau (8 columns of 5 cards each)

Randomly dealt from remaining cards.

Build down regardless of suit (for example, a 5 can be played on any 6).

The top card of each pile is available for play to another tableau pile or to the foundations.

Only one card at a time can be moved.

Spaces may be filled with any available card.

Version:
1.0
Author:
Brian Landry
See Also:
Serialized Form

Field Summary
protected  Column[] columns
           
static int columnToColumn
          Contant used to identify moves
static int columnToPile
          Constant used to identify moves
protected  ColumnView[] cv
           
protected  GrandfatherDeck gDeck
           
protected  Pile[] piles
           
protected  PileView[] pv
           
protected  IntegerView scoreView
           
protected  java.lang.String version
          Version
 
Constructor Summary
GrandfatherClock()
           
 
Method Summary
 java.util.Enumeration availableMoves()
          Required to implement SolvableSolitaire.
 java.lang.String getName()
          Returns name of game
 java.awt.Dimension getPreferredSize()
          Overrides function from Solitaire to initialize the screen to a larger size.
 java.lang.String getVersion()
          Returns version
 boolean hasWon()
          Examines the score to determine if player has won
 void initialize()
          Initializes games: creates entity, boundary, and view objects.
protected  void initializeControllers()
          Initialize boundary objects
protected  void initializeModel(int seed)
          Initializes entity objects
protected  void initializeView()
          Initializes view objects
protected static int randomNumber(int max)
          A function that generates random integers 0<=x
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

gDeck

protected GrandfatherDeck gDeck

columns

protected Column[] columns

piles

protected Pile[] piles

cv

protected ColumnView[] cv

pv

protected PileView[] pv

scoreView

protected IntegerView scoreView

columnToPile

public static final int columnToPile
Constant used to identify moves

See Also:
Constant Field Values

columnToColumn

public static final int columnToColumn
Contant used to identify moves

See Also:
Constant Field Values

version

protected java.lang.String version
Version

Constructor Detail

GrandfatherClock

public GrandfatherClock()
Method Detail

initialize

public void initialize()
Initializes games: creates entity, boundary, and view objects. Deals cards.


initializeModel

protected void initializeModel(int seed)
Initializes entity objects


initializeView

protected void initializeView()
Initializes view objects


initializeControllers

protected void initializeControllers()
Initialize boundary objects


hasWon

public boolean hasWon()
Examines the score to determine if player has won


getName

public java.lang.String getName()
Returns name of game


getVersion

public java.lang.String getVersion()
Returns version


getPreferredSize

public java.awt.Dimension getPreferredSize()
Overrides function from Solitaire to initialize the screen to a larger size. Again, note that this plugin requires a monitor with 1024x768 resolution.


availableMoves

public java.util.Enumeration availableMoves()
Required to implement SolvableSolitaire. This function examines the game and returns an Enumeration of possible moves


randomNumber

protected static int randomNumber(int max)
A function that generates random integers 0<=x
Parameters:
max - int the maximum value for the random integer