org.ninm.games.cardgames.belot
Class BelotTrick

java.lang.Object
  |
  +--org.ninm.games.cardgames.belot.BelotTrick
All Implemented Interfaces:
Trick

public final class BelotTrick
extends java.lang.Object
implements Trick

This class represents a trick used in the belot game

Version:
1.0
Author:
Nikolay

Nested Class Summary
static class BelotTrick.Type
           
 
Field Summary
private  Card[] m_cards
           
private  int m_highestFaceIndex
           
private  java.lang.String m_name
           
private  Player m_player
           
private  Suit m_suit
           
private  BelotTrick.Type m_type
           
private  int m_value
           
 
Constructor Summary
protected BelotTrick(java.util.Set cards, Player player)
           
 
Method Summary
 boolean beats(BelotTrick other)
          returns true if this trick superseeds the passed in trick (rendering it pointless)
private  int calculateHighestFaceIndex()
           
private  java.lang.String calculateName()
           
private  Suit calculateSuit()
           
private  BelotTrick.Type calculateType()
           
private  int calculateValue()
           
 boolean conflictsWith(BelotTrick other)
           
static boolean containsBelot(java.util.Set set)
           
 boolean equals(java.lang.Object obj)
           
static java.util.Set findBelot(java.util.Set cards, Player player, java.util.Set trumps, Card firstCard)
           
static java.util.Set findTricks(java.util.Set cards, Player player)
           
 java.util.Set getCards()
           
 java.lang.String getName()
          returns the name of this bonus
 Player getPlayer()
          returns the player that announced this trick
 BelotTrick.Type getType()
           
 int getValue()
          returns the value of this bonus
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

m_player

private final Player m_player

m_name

private final java.lang.String m_name

m_suit

private final Suit m_suit

m_type

private final BelotTrick.Type m_type

m_cards

private final Card[] m_cards

m_highestFaceIndex

private final int m_highestFaceIndex

m_value

private final int m_value
Constructor Detail

BelotTrick

protected BelotTrick(java.util.Set cards,
                     Player player)
Method Detail

calculateSuit

private Suit calculateSuit()

calculateType

private BelotTrick.Type calculateType()

calculateHighestFaceIndex

private int calculateHighestFaceIndex()

calculateName

private java.lang.String calculateName()

calculateValue

private int calculateValue()

getValue

public int getValue()
Description copied from interface: Trick
returns the value of this bonus

Specified by:
getValue in interface Trick
Returns:
float

getName

public java.lang.String getName()
Description copied from interface: Trick
returns the name of this bonus

Specified by:
getName in interface Trick
Returns:
String the name of the bonus

getPlayer

public Player getPlayer()
Description copied from interface: Trick
returns the player that announced this trick

Specified by:
getPlayer in interface Trick
Returns:
Player the player that announced the trick

beats

public boolean beats(BelotTrick other)
returns true if this trick superseeds the passed in trick (rendering it pointless)

Parameters:
other - the other trick
Returns:
boolean true if this trick superseeds the passed in trick

findBelot

public static java.util.Set findBelot(java.util.Set cards,
                                      Player player,
                                      java.util.Set trumps,
                                      Card firstCard)

findTricks

public static java.util.Set findTricks(java.util.Set cards,
                                       Player player)

containsBelot

public static boolean containsBelot(java.util.Set set)

getType

public BelotTrick.Type getType()

conflictsWith

public boolean conflictsWith(BelotTrick other)

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getCards

public java.util.Set getCards()

SourceForge.net Logo