jskat.data
Class SkatSeriesData

java.lang.Object
  extended by java.util.Observable
      extended by jskat.data.SkatSeriesData

public class SkatSeriesData
extends java.util.Observable

A skat round

Author:
Jan Schäfer

Field Summary
 int GAMES_IN_PROGRESS
           
(package private) static org.apache.log4j.Logger log
           
 int NEW_SERIES
           
 int PLAYERS_READY
           
 int SERIES_FINISHED
           
 
Constructor Summary
SkatSeriesData(JSkatPlayer[] players, long roundsToPlay)
          Creates a new instance of a skat round
 
Method Summary
 void addNewGame(SkatGame newGame)
          Adds a new skat game
 void addRamschGame()
          Adds a new ramsch game
 void addRoundOfRamschGames()
          Adds a new round of ramsch games
 java.util.Vector calculateWinsAndLosses()
          Calculates all wins and losses of the players
 int countGames()
          Returns the number of games already played
 int getBockGamesToPlay()
           
 int getBockRoundsToPlay()
           
 SkatGame getCurrGame()
           
 SkatGameData getCurrGameData()
          Get the data of the current skat game
 long getMaxRounds()
          Gets the maximal number of rounds to be played
 JSkatPlayer[] getPlayers()
          Get the player as ArrayList
 int getRamschGamesToPlay()
          Returns the number of ramsch games to be played
 int getState()
          Gets the state of the series
 boolean isGameLeft()
          Gets whether there are games left to be played or not
 boolean isOpenRounds()
          Checks whether there are still rounds to be played
 boolean isRamschGamesRemaining()
          Checks, whether there are any ramsch games left to be played
 boolean isUnlimitedNumberOfGames()
          Gets whether unlimited number of games should be played
 void ramschGameFinished()
           
 void setBockGamesToPlay(int bockGamesToPlay)
           
 void setBockRoundsToPlay(int bockRoundsToPlay)
           
 void setMaxRounds(long maxRounds)
          Sets the maximal number of rounds to be played
 void setPlayers(JSkatPlayer[] newPlayers)
          Set the players
 void setRamschGamesToPlay(int ramschGameCount)
          Sets the number of ramsch games to be played
 void setUnlimitedNumberOfGames(boolean unlimitedNumberOfGames)
          Sets whether unlimited number of games should be played
 
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

log

static org.apache.log4j.Logger log

NEW_SERIES

public final int NEW_SERIES
See Also:
Constant Field Values

PLAYERS_READY

public final int PLAYERS_READY
See Also:
Constant Field Values

GAMES_IN_PROGRESS

public final int GAMES_IN_PROGRESS
See Also:
Constant Field Values

SERIES_FINISHED

public final int SERIES_FINISHED
See Also:
Constant Field Values
Constructor Detail

SkatSeriesData

public SkatSeriesData(JSkatPlayer[] players,
                      long roundsToPlay)
Creates a new instance of a skat round

Method Detail

getState

public int getState()
Gets the state of the series

Returns:
The state of the series

addNewGame

public void addNewGame(SkatGame newGame)
Adds a new skat game

Parameters:
newGame - The new game

getCurrGameData

public SkatGameData getCurrGameData()
Get the data of the current skat game


getCurrGame

public SkatGame getCurrGame()

getPlayers

public JSkatPlayer[] getPlayers()
Get the player as ArrayList


setPlayers

public void setPlayers(JSkatPlayer[] newPlayers)
Set the players

Parameters:
newPlayers -

calculateWinsAndLosses

public java.util.Vector calculateWinsAndLosses()
Calculates all wins and losses of the players

Returns:
A Vector with the wins and losses of the players

getRamschGamesToPlay

public int getRamschGamesToPlay()
Returns the number of ramsch games to be played

Returns:
The number of ramsch games to be played

setRamschGamesToPlay

public void setRamschGamesToPlay(int ramschGameCount)
Sets the number of ramsch games to be played

Parameters:
ramschGameCount - The number of ramsch games to be played

ramschGameFinished

public void ramschGameFinished()

addRoundOfRamschGames

public void addRoundOfRamschGames()
Adds a new round of ramsch games


addRamschGame

public void addRamschGame()
Adds a new ramsch game


isRamschGamesRemaining

public boolean isRamschGamesRemaining()
Checks, whether there are any ramsch games left to be played

Returns:
TRUE, if there are ramsch games left to be played

getBockGamesToPlay

public int getBockGamesToPlay()
Returns:
Returns the bockGamesToPlay.

getBockRoundsToPlay

public int getBockRoundsToPlay()
Returns:
Returns the bockRoundsToPlay.

setBockGamesToPlay

public void setBockGamesToPlay(int bockGamesToPlay)
Parameters:
bockGamesToPlay - The bockGamesToPlay to set.

setBockRoundsToPlay

public void setBockRoundsToPlay(int bockRoundsToPlay)
Parameters:
bockRoundsToPlay - The bockRoundsToPlay to set.

countGames

public int countGames()
Returns the number of games already played

Returns:
number of games that have been played

isOpenRounds

public boolean isOpenRounds()
Checks whether there are still rounds to be played

Returns:
TRUE when there are still round to be played

setMaxRounds

public void setMaxRounds(long maxRounds)
Sets the maximal number of rounds to be played

Parameters:
maxRounds - Maximal number of rounds to be played

getMaxRounds

public long getMaxRounds()
Gets the maximal number of rounds to be played

Returns:
Maximal number of rounds to be played

setUnlimitedNumberOfGames

public void setUnlimitedNumberOfGames(boolean unlimitedNumberOfGames)
Sets whether unlimited number of games should be played

Parameters:
unlimitedNumberOfGames - TRUE if unlimited number of games should be played

isUnlimitedNumberOfGames

public boolean isUnlimitedNumberOfGames()
Gets whether unlimited number of games should be played

Returns:
TRUE when ulimited number of games should be played

isGameLeft

public boolean isGameLeft()
Gets whether there are games left to be played or not

Returns:
TRUE when there are games left to be played