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
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
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
BelotTrick
protected BelotTrick(java.util.Set cards,
Player player)
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()