|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.Observable
jskat.control.SkatGame
public class SkatGame
| Field Summary | |
|---|---|
static int |
GAMESTATE_AI_PLAYER_PLAYING
|
static int |
GAMESTATE_BIDDING
|
static int |
GAMESTATE_CREATED
Status of the game |
static int |
GAMESTATE_DEALING
|
static int |
GAMESTATE_DOING_SCHIEBERRAMSCH
|
static int |
GAMESTATE_GAME_OVER
|
static int |
GAMESTATE_INITIALISED
|
static int |
GAMESTATE_NEW_TRICK_STARTED
|
static int |
GAMESTATE_NEXT_GAME
|
static int |
GAMESTATE_PLAYING
|
static int |
GAMESTATE_SHOWING_SKAT
|
static int |
GAMESTATE_STARTED
|
static int |
GAMESTATE_TRICK_COMPLETED
|
static int |
GAMESTATE_WAIT_FOR_HUMAN_PLAYER_INPUT
|
| Constructor Summary | |
|---|---|
SkatGame(JSkatDataModel dataModel,
SkatSeries skatSeries,
int dealer)
|
|
| Method Summary | |
|---|---|
protected void |
calculateTrickWinner()
Calculates the winner of the current trick |
void |
dealCards()
Deals the cards to the skat players |
BidStatus |
getBidStatus()
Gets the current bid status |
int |
getDealer()
|
int[] |
getPlayerOrder()
|
SkatGameData |
getSkatGameData()
Returns the data of the game |
SkatTableOptions |
getSkatTableOptions()
|
int |
getState()
Get the state of the game |
boolean |
isJSkatPlayedByHuman()
Get the information whether JSkat is played by a human or not |
void |
notifyBiddingThread(boolean userBidsMore)
Promotes user input to the bidding thread |
void |
notifySchieberRamschThread()
Promotes user input to the SchieberRamschThread |
void |
playing(GameAnnouncement newGame)
Controls the playing of a game |
protected void |
playTrickCard(int suit,
int value)
Check if the human card is valid and then ask all AI players that come after the human player |
protected void |
putCardIntoSkat(int suit,
int value)
Puts a card into the skat |
void |
showSkat()
Shows the skat to the single player (or asks a human player whether he wants to look into the skat) and announces the game. |
void |
skatProcessed()
After a human player has processed the skat the game announcing dialog is called |
protected void |
takeCardFromSkat(int suit,
int value)
Gives a card from the skat to a player |
void |
updateDealtCards(int playerID)
Updates the dealt cards vector |
| Methods inherited from class java.util.Observable |
|---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int GAMESTATE_CREATED
public static final int GAMESTATE_INITIALISED
public static final int GAMESTATE_STARTED
public static final int GAMESTATE_DEALING
public static final int GAMESTATE_BIDDING
public static final int GAMESTATE_SHOWING_SKAT
public static final int GAMESTATE_PLAYING
public static final int GAMESTATE_DOING_SCHIEBERRAMSCH
public static final int GAMESTATE_AI_PLAYER_PLAYING
public static final int GAMESTATE_WAIT_FOR_HUMAN_PLAYER_INPUT
public static final int GAMESTATE_TRICK_COMPLETED
public static final int GAMESTATE_NEW_TRICK_STARTED
public static final int GAMESTATE_GAME_OVER
public static final int GAMESTATE_NEXT_GAME
| Constructor Detail |
|---|
public SkatGame(JSkatDataModel dataModel,
SkatSeries skatSeries,
int dealer)
dataModel - The data model of JSkatskatSeries - The skat series where the game is played| Method Detail |
|---|
public void playing(GameAnnouncement newGame)
newGame - public SkatGameData getSkatGameData()
protected void calculateTrickWinner()
public void dealCards()
public void updateDealtCards(int playerID)
playerID - ID of the playerpublic void notifyBiddingThread(boolean userBidsMore)
userBidsMore - TRUE if the user wants to bid more otherwise FALSEpublic void notifySchieberRamschThread()
public void showSkat()
protected void playTrickCard(int suit,
int value)
suit - suit for human cardvalue - value for human card
protected void putCardIntoSkat(int suit,
int value)
suit - value -
protected void takeCardFromSkat(int suit,
int value)
suit - value - public BidStatus getBidStatus()
public boolean isJSkatPlayedByHuman()
public int[] getPlayerOrder()
public int getState()
public void skatProcessed()
public int getDealer()
public SkatTableOptions getSkatTableOptions()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||