ks.common.model
Class BuildablePile

java.lang.Object
  extended byks.common.model.Element
      extended byks.common.model.Stack
          extended byks.common.model.BuildablePile

public class BuildablePile
extends Stack

A Model Element consisting of a pile of face down cards, on top of which one can build downwards.

Creation date: (11/9/01 9:48:33 PM)


Constructor Summary
BuildablePile()
          BuildablePile constructor comment.
BuildablePile(java.lang.String name)
          Construct an empty BuildablePile with given name.
 
Method Summary
 boolean faceUp()
          Returns whether the top of the BuildablePile is face up.
 boolean flipCard()
          Flips the faceup state of the topmost card on the BuildablePile.
 int getNumFaceDown()
          Return the number of cards in this BuildablePile that are face down.
 int getNumFaceUp()
          Return the number of cards in this BuildablePile that are face up.
 
Methods inherited from class ks.common.model.Stack
add, alternatingColors, alternatingColors, ascending, ascending, count, descending, descending, deselect, empty, get, getNumSelectedCards, getSelected, peek, peek, push, rank, removeAll, sameColor, sameColor, sameRank, sameRank, sameSuit, sameSuit, select, select, suit, toString
 
Methods inherited from class ks.common.model.Element
getListener, getName, setListener, setName
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BuildablePile

public BuildablePile()
BuildablePile constructor comment.


BuildablePile

public BuildablePile(java.lang.String name)
Construct an empty BuildablePile with given name.

Parameters:
name - String
Method Detail

faceUp

public boolean faceUp()
Returns whether the top of the BuildablePile is face up.

Note: an empty BuildablePile is returned as false

Returns:
int

flipCard

public boolean flipCard()
Flips the faceup state of the topmost card on the BuildablePile.

Generates modelChanged action if BuildablePile is not empty.

Returns:
boolean if able to flip the card on top of the BuildablePile

getNumFaceDown

public int getNumFaceDown()
Return the number of cards in this BuildablePile that are face down.

Returns:
int

getNumFaceUp

public int getNumFaceUp()
Return the number of cards in this BuildablePile that are face up.

Returns:
int