jagafa.object
Class GoneCardHeap

java.lang.Object
  extended by jagafa.object.CardList
      extended by jagafa.object.GoneCardHeap

public class GoneCardHeap
extends CardList

GoneCardHeap is a CardList which holds all Cards that have been played during a Game, including the winners of every turn


Constructor Summary
GoneCardHeap()
          Constructor: Init the winner and board Lists
 
Method Summary
 void addTurn(Board b, Player winner)
          Adds the turn to the GoneCardHeap
 Board getBoard(int turnNr)
           
 CardList getGoneOfColor(int color)
          Dummy method: Used in GoneCardHeap only
 Card getPlayedCard(Player player, Board b)
          Get the card a specific Player played on a specific Board
 Player getWinner(int turnNr)
           
 boolean hasPlayedColorIn(Player player, Board board)
           
 boolean isGone(Card c)
           
 int turns()
           
 
Methods inherited from class jagafa.object.CardList
add, addAll, clear, contains, get, isEmpty, iterator, list, remove, remove, size, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GoneCardHeap

public GoneCardHeap()
Constructor: Init the winner and board Lists

Method Detail

addTurn

public void addTurn(Board b,
                    Player winner)
Adds the turn to the GoneCardHeap

Parameters:
b - The turns Board object
winner - The turns winner

isGone

public boolean isGone(Card c)
Returns:
True, if the card is in the GoneCardHeap

getGoneOfColor

public CardList getGoneOfColor(int color)
Description copied from class: CardList
Dummy method: Used in GoneCardHeap only

Overrides:
getGoneOfColor in class CardList
Parameters:
color - The color number
Returns:
a CardList with all the Cards of the color given in the GoneCardHeap

getBoard

public Board getBoard(int turnNr)
Parameters:
turnNr - The turn number
Returns:
The board played in Turn number i

getWinner

public Player getWinner(int turnNr)
Parameters:
turnNr - The turn number
Returns:
The winner of the turn specified

turns

public int turns()
Returns:
The number of turns stored in the GoneCardHeap

hasPlayedColorIn

public boolean hasPlayedColorIn(Player player,
                                Board board)
Parameters:
player - The relevant player
board - The relevant board
Returns:
True, if the Player player has played "color" in the Board given

getPlayedCard

public Card getPlayedCard(Player player,
                          Board b)
Get the card a specific Player played on a specific Board

Parameters:
player - The relevant player
b - The relevant board
Returns:
The Card Player p has played in the Board given


Copyright 2005 MA Software. All Rights Reserved.