sjrd.tricktakinggame.rules.whist.announces
Class GapAnnounce

java.lang.Object
  extended by sjrd.tricktakinggame.remotable.Announce
      extended by sjrd.tricktakinggame.rules.whist.WhistAnnounce
          extended by sjrd.tricktakinggame.rules.whist.announces.GapAnnounce

public class GapAnnounce
extends WhistAnnounce

Annonce Trou (royal ou non)

Author:
sjrd

Field Summary
private  boolean royal
          Indique si c'est un trou royal
private  Card stopgapCard
          Carte qui doit boucher le trou
 
Constructor Summary
GapAnnounce(Player aPlayer, Card aStopgapCard)
          Crée l'annonce
GapAnnounce(Player aPlayer, String aID, String aName, boolean aRoyal, Card aStopgapCard)
          Crée l'annonce
 
Method Summary
static GapAnnounce checkForGap(Auction auction)
          Teste s'il y a un trou
private static Card findStopgapCard(Player player)
          Détermine la carte qui doit boucher le trou
 int getOrderValue()
          Valeur d'ordre
 Card getStopgapCard()
          Carte qui doit bouché le trou
 boolean isRoyal()
          Indique si c'est un trou royal
 void makeAvailableAnnounces(WhistAuction auction, Player player, List<WhistAnnounce> announces)
          Construit les annonces disponibles après cette annonce Cette méthode peut ajouter et/ou retirer des annonces possibles à la liste announces passée en paramètre.
private static String makeID(Card stopgapCard)
          Construit l'ID d'une annonce Trou
private static String makeName(Card stopgapCard)
          Construit le nom d'une annonce Trou
 
Methods inherited from class sjrd.tricktakinggame.rules.whist.WhistAnnounce
canOverride, equals, getPartner, getPlayer, replaced, selected
 
Methods inherited from class sjrd.tricktakinggame.remotable.Announce
getID, getName, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

royal

private boolean royal
Indique si c'est un trou royal


stopgapCard

private Card stopgapCard
Carte qui doit boucher le trou

Constructor Detail

GapAnnounce

public GapAnnounce(Player aPlayer,
                   String aID,
                   String aName,
                   boolean aRoyal,
                   Card aStopgapCard)
Crée l'annonce

Parameters:
aPlayer - Joueur qui fait l'annonce
aID - ID de l'annonce
aName - Nom de l'annonce
aRoyal - true si c'est un trou royal
aStopgapCard - Carte qui doit boucher le trou

GapAnnounce

public GapAnnounce(Player aPlayer,
                   Card aStopgapCard)
Crée l'annonce

Parameters:
aPlayer - Joueur qui fait l'annonce
aStopgapCard - Carte qui doit boucher le trou
Method Detail

findStopgapCard

private static Card findStopgapCard(Player player)
Détermine la carte qui doit boucher le trou

Parameters:
player - Joueur qui fait l'annonce
Returns:
Carte qui doit boucher le trou (null si pas de trou)

makeID

private static String makeID(Card stopgapCard)
Construit l'ID d'une annonce Trou

Parameters:
stopgapCard - Carte qui doit boucher le trou
Returns:
ID de l'annonce

makeName

private static String makeName(Card stopgapCard)
Construit le nom d'une annonce Trou

Parameters:
stopgapCard - Carte qui doit boucher le trou
Returns:
Nom de l'annonce

checkForGap

public static GapAnnounce checkForGap(Auction auction)
Teste s'il y a un trou

Parameters:
auction - Enchères
Returns:
Annonce de trou s'il y en a un, null sinon

isRoyal

public boolean isRoyal()
Indique si c'est un trou royal

Returns:
true si c'est un trou royal, false sinon

getStopgapCard

public Card getStopgapCard()
Carte qui doit bouché le trou

Returns:
Carte qui doit bouché le trou

getOrderValue

public int getOrderValue()
Valeur d'ordre

Specified by:
getOrderValue in class WhistAnnounce
Returns:
Valeur d'ordre

makeAvailableAnnounces

public void makeAvailableAnnounces(WhistAuction auction,
                                   Player player,
                                   List<WhistAnnounce> announces)
Construit les annonces disponibles après cette annonce

Cette méthode peut ajouter et/ou retirer des annonces possibles à la liste announces passée en paramètre.

Specified by:
makeAvailableAnnounces in class WhistAnnounce
Parameters:
auction - Enchère
player - Joueur
announces - Liste des annonces