|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
|
+--de.uni_paderborn.robots.robotArenaInterface.ItemData
|
+--de.uni_paderborn.robots.robotArenaInterface.CardData
This class contains the necessary information to identify a card. This class is used in two ways: (1) as attribute of "RobotData" ( parameter of "getCommand" ) to provide the robot with his current hand of cards (2) as attribute of PutAction or ExchangeAction if the robot wants to put a card down or exchange it with another one in front of him made class final to allow no futher changes by groups nearly complete
| Fields inherited from interface de.uni_paderborn.robots.robotArenaInterface.CardConstants |
ACE, CLUB, DIAMOND, EIGHT, FIVE, FLUSH, FOUR, FOUR_OF_A_KIND, FULL_HOUSE, HEART, JACK, KING, LADY, NINE, NOTHING, ONE_PAIR, ROYAL_FLUSH, SEVEN, SIX, SPADE, STRAIGHT, STRAIGHT_FLUSH, TEN, THREE, THREE_OF_A_KIND, TWO, TWO_PAIRS |
| Constructor Summary | |
CardData(byte color,
byte value)
constructor used to create a card which a element of the hand of the robot. a robot should NEVER create a card !!! |
|
| Method Summary | |
static CardData[] |
cardSort(CardData[] cards)
|
java.lang.Object |
clone()
returns a reference to a cloned CardData |
int |
compareTo(java.lang.Object o)
used to compara two cards see Comparable for return value definition a.compareTo(b) is negative for a < b 0 for a == b positive for a > b |
byte |
getColor()
returns a value between 1 and 4 : constant value DIAMOND = 1 (german: Karo) HEART = 2 (german: Herz) SPADE = 3 (german: Pik) CLUB = 4 (german: Kreuz) |
static int |
getHandValue(CardData[] hand)
|
byte |
getValue()
returns a value between 2 and 14 : constant value TWO = 2 (german: Zwei) THREE = 3 (german: Drei) FOUR = 4 (german: Vier) FIVE = 5 (german: Fünf) SIX = 6 (german: Sechs) SEVEN = 7 (german: Sieben) EIGHT = 8 (german: Acht) NINE = 9 (german: Neun) TEN = 10 (german: Zehn) JACK = 11 (german: Bube) LADY = 12 (german: Dame) KING = 13 (german: König) ACE = 14 (german: As) |
static java.lang.String |
stringTypeOfScore(int score)
returns the calculate type of score as a string |
java.lang.String |
toString()
returns the string representation of the card |
static int |
typeOfScore(int score)
calculate type of score and returns it |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public CardData(byte color,
byte value)
throws java.lang.IllegalArgumentException
| Method Detail |
public byte getColor()
public byte getValue()
public int compareTo(java.lang.Object o)
compareTo in interface java.lang.Comparablepublic java.lang.Object clone()
clone in class java.lang.Objectpublic static CardData[] cardSort(CardData[] cards)
public static int getHandValue(CardData[] hand)
public static int typeOfScore(int score)
public static java.lang.String stringTypeOfScore(int score)
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||