|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjskat.player.AIPlayerMJL.Helper
public class Helper
| Constructor Summary | |
|---|---|
Helper()
|
|
| Method Summary | |
|---|---|
static int |
binaryToSuit(int binary)
Converts a binary stream to a suit color |
static int |
countJacks(CardVector cards)
Gets the number of jacks in the given hand |
static int |
getHighestTrump(CardVector cards,
int currTrump)
Gets the highest trump card out of a given hand |
static int |
getJacks(CardVector cards)
Gets a binary representation of the jacks in the given hand |
static int |
getMultiplier(CardVector cards)
Gets the game multiplier |
static boolean |
hasTrump(CardVector cards,
int currTrump)
Checks, whether there is at least one trump card in a given hand |
static int |
isAbleToBeat(CardVector cards,
Card cardToBeat,
int trump,
Card initialCard,
int gameType)
Decides whether a player is able to beat a certain card |
static boolean |
isAbleToMatch(CardVector cards,
int trump,
Card initialCard,
int gameType)
Decides whether a player is able to match a certain initial card |
static boolean |
isSinglePlayerWin(TrickInfo trick)
Checks whether the current trick would be won by the single player, so that the AIPlayer can decide which card to play |
static int |
suitCardsToBinary(CardVector cards,
int suit)
Converts a hand's cards of a certain suit to a binary stream |
static int |
suitCardsToBinaryNullGame(CardVector cards,
int suit)
Converts a hand's cards of a certain suit to a binary stream for a null game (which means that jacks are also considered) |
static int |
suitCardsToBinaryWithSkat(CardVector cards,
CardVector skat,
int suit)
Converts a hand's and the skat's cards of a certain suit to a binary stream |
static java.lang.String |
suitName(int suit)
Converts the suit value to a suit name (one character) "D" for Diamonds, "H" for Hearts, "S" for Spades, "C" for Clubs |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Helper()
| Method Detail |
|---|
public static boolean isSinglePlayerWin(TrickInfo trick)
trick - All the necessary trick infos
public static int isAbleToBeat(CardVector cards,
Card cardToBeat,
int trump,
Card initialCard,
int gameType)
cards - hand of the playercardToBeat - card that should be beatentrump - current trump colorinitialCard - initial card of the trickgameType - game type
public static boolean isAbleToMatch(CardVector cards,
int trump,
Card initialCard,
int gameType)
cards - trump - initialCard - gameType -
public static int getHighestTrump(CardVector cards,
int currTrump)
cards - a handcurrTrump - the current trump color
public static boolean hasTrump(CardVector cards,
int currTrump)
cards - a handcurrTrump - trump color
public static int getMultiplier(CardVector cards)
cards - a hand
public static int suitCardsToBinaryWithSkat(CardVector cards,
CardVector skat,
int suit)
cards - a handskat - the skatsuit - only cards of this suit are considered
public static int suitCardsToBinary(CardVector cards,
int suit)
cards - a handsuit - only cards of this suit are considered
public static int suitCardsToBinaryNullGame(CardVector cards,
int suit)
cards - a handsuit - only cards of this suit are considered
public static int getJacks(CardVector cards)
cards - a hand
public static int countJacks(CardVector cards)
cards - a hand
public static int binaryToSuit(int binary)
binary - binary stream (four bits)
public static java.lang.String suitName(int suit)
suit - suit value
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||