|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.Observable
jagafa.JassRoundCore
public abstract class JassRoundCore
| Field Summary | |
|---|---|
protected javax.swing.Timer |
aiTimer_
|
protected javax.swing.Timer |
refreshTimer_
|
protected boolean |
running_
|
protected ScoreTable |
scoreTable_
|
| Constructor Summary | |
|---|---|
JassRoundCore(RuleSet rules)
Initialize a new game using the RuleSet given |
|
| Method Summary | |
|---|---|
Board |
activeBoard()
Returns the active Board |
Player |
activePlayer()
Returns the active Player |
int |
activePlayerNr()
Returns the active Players' id |
protected void |
addPlayer(Player newPlayer)
|
GoneCardHeap |
getGoneHeap()
Returns the Gone Card Heap |
protected Player |
getLastTurnWinner()
Returns the Player which was the winner of the previous turn |
Player[] |
getOpponents(Player p)
Returns the opponents of the Player p |
Player |
getPartner(Player pl)
Returns the Partner of Player pl |
Player |
getPlayer(int i)
Returns the player with the id given |
int |
getPlayerNr(Player p)
Returns an id for the player p |
RuleSet |
getRules()
Returns the RuleSet |
protected int |
getScore(Board board)
Counts the score on a board |
ScoreTable |
getScoreTable()
Get the score table |
protected Player |
getWinner(Board board)
Returns the winning Player of the board given |
protected abstract void |
initPlayers()
|
boolean |
isRoundOver()
Returns true if the game is over |
boolean |
isRunning()
|
boolean |
isValidPlay(Card toPlay)
Checks wether a card is valid to play on the active Board or not |
protected Player |
nextPlayer()
Sets the active player to the next |
protected void |
reportScores()
Update the score table after a round is finished (Report round scores to top-level game) |
void |
reset()
Reset everything |
void |
setActivePlayer(Player playerToSet)
Set the active player |
protected void |
setLastTurnWinner(Player winner)
|
void |
setRules(RuleSet r)
Set the RuleSet |
void |
setScoreTable(ScoreTable table)
Sets the score table |
void |
stop()
|
void |
toggleNotify()
Notify observers and fire all action-listeners |
| 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 |
|---|
protected boolean running_
protected javax.swing.Timer refreshTimer_
protected javax.swing.Timer aiTimer_
protected ScoreTable scoreTable_
| Constructor Detail |
|---|
public JassRoundCore(RuleSet rules)
| Method Detail |
|---|
public void setRules(RuleSet r)
public boolean isRunning()
public int activePlayerNr()
public Player activePlayer()
protected int getScore(Board board)
protected Player getWinner(Board board)
public boolean isRoundOver()
protected Player nextPlayer()
public void setActivePlayer(Player playerToSet)
public void toggleNotify()
public Player getPlayer(int i)
protected Player getLastTurnWinner()
public int getPlayerNr(Player p)
public RuleSet getRules()
public GoneCardHeap getGoneHeap()
public Player getPartner(Player pl)
public Player[] getOpponents(Player p)
public boolean isValidPlay(Card toPlay)
public Board activeBoard()
public void reset()
protected abstract void initPlayers()
protected void setLastTurnWinner(Player winner)
protected void addPlayer(Player newPlayer)
public void setScoreTable(ScoreTable table)
table - The relevant score table where the rounds score will be reportedpublic ScoreTable getScoreTable()
protected void reportScores()
public void stop()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||