|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An object which an Intelligence
can use to determine the rules under which a Game
is being played.
Method Summary | |
CardArray |
getDeck()
Returns the deck that will be used. |
int |
getNumberOfPlayers()
Returns the number of players in this Intelligence.Game . |
CardArray |
getTakeAllCards()
Returns the set of Card s which must be taken by a single player in order to execute a take-all. |
int |
getTakeAllScore()
Returns the number of points that are awarded for a take-all. |
int |
getValue(CardArray cards)
Returns the total point (scoring) value of the cards in the given CardArray , as if they were the cards
taken in a particular hand. |
boolean |
isLegalPlay(CardArray[] previousTricks,
CardArray currentTrick,
CardArray hand,
Card card)
Returns whether a particular Card would be a legal play for a player under these Rules ,
given the situation defined by the previousTricks , currentTrick , and hand
arguments. |
Method Detail |
public int getNumberOfPlayers()
Intelligence.Game
.Intelligence.Game
. Typical Hearts games involve 3-7 players,
with 4 being the most common.public boolean isLegalPlay(CardArray[] previousTricks, CardArray currentTrick, CardArray hand, Card card)
Card
would be a legal play for a player under these Rules
,
given the situation defined by the previousTricks
, currentTrick
, and hand
arguments.previousTricks
- An array of CardArray
objects which should contain the contents of the previous
tricks during the current hand. Could be zero-length if this is the first trick. Must not be null
.currentTrick
- A CardArray
which should contain the contents of the current trick. Could be empty
if the player is about to lead. Must not be null
.hand
- A CardArray
containing the Card
s currently in the player's hand. Must not be
empty. Must not be null
.card
- A Card
that might or might not be legal to play at this time. Must be a Card
in hand
. Must not be null
.true
if card
would be legal to play given the situation defined by the other three
parameters; false
if it would not be legal to play that Card
.public int getValue(CardArray cards)
CardArray
, as if they were the cards
taken in a particular hand.cards
- A CardArray
for which to obtain the point value. Must not be null
.Card
s in the given CardArray
.public CardArray getDeck()
CardArray
object containing the full deck
being used in this game will be returned upon each invocation of this method; this object can be manipulated freely
and subsequent calls to this method will return identical CardArray
s.Rules
.public CardArray getTakeAllCards()
Card
s which must be taken by a single player in order to execute a take-all.
Different Hearts variants require different sets of Card
s be taken.CardArray
containing a list of cards which must be taken in order to execute a take-all.public int getTakeAllScore()
getTakeAllCards
for details.Rules
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |