GameField
Class Cards

java.lang.Object
  extended by GameField.Cards

public class Cards
extends java.lang.Object

Class Cards Represents a set of cards


Field Summary
private static java.util.Random alea
           
private  java.util.Vector<Card> cards
           
(package private) static int TAILLE_PAQUET
           
 
Constructor Summary
Cards(int[] type, int[] color, int[] pattern)
           
 
Method Summary
 Card getCardById(int id)
          Chercher la carte ayant id dans paquet Si carte non presente renvoie erreur (carte non presente) sinon recuperer la carte, la supprimer du paquet et renvoyer la carte
 java.util.Vector<Card> getCards()
          Get the value of cards
 Card nextCard()
          Returns a random card and REMOVE it from the set
 void setCards(java.util.Vector<Card> value)
          Set the value of cards
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

alea

private static java.util.Random alea

cards

private java.util.Vector<Card> cards

TAILLE_PAQUET

static int TAILLE_PAQUET
Constructor Detail

Cards

public Cards(int[] type,
             int[] color,
             int[] pattern)
      throws GameFieldException
Throws:
GameFieldException
Method Detail

getCardById

public Card getCardById(int id)
                 throws GameFieldException
Chercher la carte ayant id dans paquet Si carte non presente renvoie erreur (carte non presente) sinon recuperer la carte, la supprimer du paquet et renvoyer la carte

Returns:
la carte ayant l'id
Throws:
GameFieldException

getCards

public java.util.Vector<Card> getCards()
Get the value of cards

Returns:
the value of cards

nextCard

public Card nextCard()
              throws GameFieldException
Returns a random card and REMOVE it from the set

Returns:
la carte tiree au hasard
Throws:
GameFieldException

setCards

public void setCards(java.util.Vector<Card> value)
              throws GameFieldException
Set the value of cards

Parameters:
value -
Throws:
GameFieldException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
représentation de l'objet