jskat.control
Class SkatTable

java.lang.Object
  extended by java.util.Observable
      extended by jskat.control.SkatTable
All Implemented Interfaces:
java.util.Observer

public class SkatTable
extends java.util.Observable
implements java.util.Observer

SkatTable controls a SkatSeries

Author:
Jan Schäfer

Constructor Summary
SkatTable(JSkatDataModel dataModel)
           
 
Method Summary
 boolean addPlayer(JSkatPlayer newPlayer)
          Adds a player to the players on the table
 void cardPanelClicked(int panelType, int suit, int value)
          Responds to a click on a card panel
 boolean createNewSkatSeries(int numberOfRounds, java.lang.String[] playerNames, java.lang.String[] playerClasses)
          Starts a new skat series at this table
 int[] getCurrentPlayerOrder()
          Gets the current player order
 JSkatPlayer[] getPlayers()
           
 SkatTableData getSkatTableData()
          Returns the skat table data
 SkatTableOptions getSkatTableOptions()
          Gets the table options
 boolean isFreePlayerSeat()
          Asks whether there is a free player seat at the table or not
 void update(java.util.Observable o, java.lang.Object arg)
           
 
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
 

Constructor Detail

SkatTable

public SkatTable(JSkatDataModel dataModel)
Method Detail

getPlayers

public JSkatPlayer[] getPlayers()

addPlayer

public boolean addPlayer(JSkatPlayer newPlayer)
Adds a player to the players on the table

Parameters:
newPlayer -
Returns:
FALSE, if there are already five players Otherwise TRUE

isFreePlayerSeat

public boolean isFreePlayerSeat()
Asks whether there is a free player seat at the table or not

Returns:
TRUE, if there is a free seat Otherwise FALSE

createNewSkatSeries

public boolean createNewSkatSeries(int numberOfRounds,
                                   java.lang.String[] playerNames,
                                   java.lang.String[] playerClasses)
Starts a new skat series at this table

Returns:
TRUE, if the new series has started successfully Otherwise, FALSE

cardPanelClicked

public void cardPanelClicked(int panelType,
                             int suit,
                             int value)
Responds to a click on a card panel

Parameters:
panelType - ID of the CardHoldingPanel that holds the card that was clicked
suit - suit of the card that was clicked
value - value of the card that was clicked

getCurrentPlayerOrder

public int[] getCurrentPlayerOrder()
Gets the current player order

Returns:
The player order as Array of int

getSkatTableOptions

public SkatTableOptions getSkatTableOptions()
Gets the table options


getSkatTableData

public SkatTableData getSkatTableData()
Returns the skat table data

Returns:
The skat table data

update

public void update(java.util.Observable o,
                   java.lang.Object arg)
Specified by:
update in interface java.util.Observer