|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjagafa.object.Player
public class Player
The Player class holds the hand and the AI of a player. It also knows wether a he is a computer player or human. TODO: Needs refactoring: Add "partner" and "opponent" recognition to the Player class
| Constructor Summary | |
|---|---|
Player(int numberOfCards,
boolean isHuman)
Erstellt neues Spielerobjekt |
|
Player(int numberOfCards,
boolean isHuman,
JassAI ai)
|
|
| Method Summary | |
|---|---|
void |
addScore(int points)
Zählt points zum aktuellen Punktestand dazu |
boolean |
equals(java.lang.Object sec)
|
JassAI |
getAI()
Get the players AI instance |
Hand |
getHand()
Get the players hand object |
int |
getID()
|
java.lang.String |
getName()
Get the player name |
int |
getScore()
Get the players score |
int |
hashCode()
|
boolean |
isComputer()
Checks wether the player is AI-driven or not |
boolean |
playCard(Card card,
JassRound round)
Spielt eine Karte aus der hand des Spielers auf das Board von game |
void |
playCard(int i,
JassRound round)
Spielt die ite Karte aus der hand des Spielers auf das Board von game |
void |
printHand()
Gibt die Handkarten auf dem Bildschirm aus |
static void |
resetPlayerCount()
|
void |
resetScore()
Setzt Punktzahl auf Null zurück |
void |
setAI(JassAI simpleAI)
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Player(int numberOfCards,
boolean isHuman)
isHuman - True if this player is a human playernumberOfCards - The number of cards in the hand of the player
public Player(int numberOfCards,
boolean isHuman,
JassAI ai)
| Method Detail |
|---|
public void addScore(int points)
points - The score to addpublic int getScore()
public void resetScore()
public java.lang.String toString()
toString in class java.lang.Objectpublic Hand getHand()
public void printHand()
public void playCard(int i,
JassRound round)
i - The card number in the players handround - The Game object to which the player plays the cardpublic boolean isComputer()
public java.lang.String getName()
public JassAI getAI()
public boolean playCard(Card card,
JassRound round)
card - The cardround - The Game object to which the player plays the cardpublic boolean equals(java.lang.Object sec)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic void setAI(JassAI simpleAI)
public static void resetPlayerCount()
public int getID()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||