inonit.domain.game.card.hearts.ai
Class Trick

java.lang.Object
  |
  +--inonit.domain.game.card.hearts.ai.Trick

public class Trick
extends java.lang.Object

Information about a particular trick during a Hearts Hand.


Method Summary
 Card getCardPlayedBy(int index)
          Returns the Card played by the Intelligence at the given player index on this Trick, or null if the Intelligence at index has not played a Card on this Trick yet.
 CardArray getCards()
          Returns a new CardArray containing the Cards, in order, which have been played in this Trick.
 Kitty getKitty()
          Returns the Kitty associated with this Trick, if any.
 int getLed()
          Returns the player index of the Intelligence who led, or will lead, this Trick.
 int getTook()
          Returns the index of the Intelligence which took this Trick, or -1 if the trick is not over or the information is not known yet (i.e., Intelligence.trickEnded has not been invoked yet).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getLed

public int getLed()
Returns the player index of the Intelligence who led, or will lead, this Trick.
Returns:
The player index of the Intelligence who led, or will lead, this trick.

getCards

public CardArray getCards()
Returns a new CardArray containing the Cards, in order, which have been played in this Trick.
Returns:
A new CardArray containing the Cards, in order, which have been played in this Trick. Will be empty if no Cards have been played yet. The CardArray which is returned can be safely manipulated without altering the original.

getTook

public int getTook()
Returns the index of the Intelligence which took this Trick, or -1 if the trick is not over or the information is not known yet (i.e., Intelligence.trickEnded has not been invoked yet).
Returns:
the player index of the Intelligence which took this trick, or -1 if the Trick has not been taken yet or the Intelligence taking it is not known.

getCardPlayedBy

public Card getCardPlayedBy(int index)
Returns the Card played by the Intelligence at the given player index on this Trick, or null if the Intelligence at index has not played a Card on this Trick yet.
Parameters:
index - A player index, with 0 indicating this AbstractIntelligence, 1 indicating the Intelligence to this AbstractIntelligence's left, and so forth.
Returns:
The Card played by the Intelligence specified by index, or null if that Intelligence has not yet played a Card in this Trick.

getKitty

public Kitty getKitty()
Returns the Kitty associated with this Trick, if any. A Kitty will be associated with the Trick if:
Returns:
The Kitty which was added to this Trick when it was taken, or null if this Trick does not have an associated Kitty.