Class CellPiles

java.lang.Object
  extended by CellPiles

public class CellPiles
extends java.lang.Object


Field Summary
static int NUM_CELLS
           
 
Constructor Summary
CellPiles()
          Given our static int we can generate a certain amount of cell piles
 
Method Summary
 boolean addCard(Card card, int cellNum)
          Adds a card to the appropriate cell, the Cell object already checks if the cell is empty or not
 void clear()
          Clears all the cells, so when you redeal you won't have a problem.
 CardPile[] getAllCells()
          Returns an array of CardPile objects that represents all of the cells
 Card getCard(int cellNum)
          In order to make checks on a given card, or to see if a card is available, this method helps you out
 java.util.ArrayList<Card> getCards()
          Returns all the cards in the cells
 CardPile getCell(int num)
          Returns the cell at index num
 int getNumEmpty()
          Gets the number of free cells available to use
 boolean isEmpty(int cellNum)
          Checks to see if a certain cell is empty or not just in case you want to move other cards into it
static void main(java.lang.String[] args)
           
 Card removeCard(int cellNum)
          Removes a card to the appropriate cell, the Cell object already checks if the cell is empty or not
 void update()
          Tells the view for each cell to update itself
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NUM_CELLS

public static final int NUM_CELLS
See Also:
Constant Field Values
Constructor Detail

CellPiles

public CellPiles()
Given our static int we can generate a certain amount of cell piles

Method Detail

addCard

public boolean addCard(Card card,
                       int cellNum)
Adds a card to the appropriate cell, the Cell object already checks if the cell is empty or not

Parameters:
card - is the Card Object to add to the cell if empty
cellNum - is the cell number to put it in, 0-3

removeCard

public Card removeCard(int cellNum)
Removes a card to the appropriate cell, the Cell object already checks if the cell is empty or not

Parameters:
cellNum - is the cell number to put it in, 0-3
Returns:
the Card off the pile

getNumEmpty

public int getNumEmpty()
Gets the number of free cells available to use

Returns:
an int that is the number of free cells

getCard

public Card getCard(int cellNum)
In order to make checks on a given card, or to see if a card is available, this method helps you out

Parameters:
cellNum - the Cell you are trying to access
Returns:
the Card in that Cell if any.

getCards

public java.util.ArrayList<Card> getCards()
Returns all the cards in the cells

Returns:
ArrayList of cards in the cells

isEmpty

public boolean isEmpty(int cellNum)
Checks to see if a certain cell is empty or not just in case you want to move other cards into it

Parameters:
cellNum - the cell number 0-3, that you wanna test
Returns:
true if the cell is empty, false otherwise

clear

public void clear()
Clears all the cells, so when you redeal you won't have a problem.


getCell

public CardPile getCell(int num)
Returns the cell at index num

Parameters:
num - the index of the cell you want
Returns:
the cell at index num

getAllCells

public CardPile[] getAllCells()
Returns an array of CardPile objects that represents all of the cells

Returns:
all of the cells

update

public void update()
Tells the view for each cell to update itself


main

public static void main(java.lang.String[] args)