jskat.data
Class BidStatus

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

public class BidStatus
extends java.util.Observable

Holds all bidding data during the bidding

Author:
Jan Schäfer

Constructor Summary
BidStatus()
          Creates a new instance of BidStatus
 
Method Summary
 int getBidValue(int hand)
          Gets the current bid value for a hand
 boolean getButtonsEnabled()
          Gets the information whether the buttons are enabled or not
 int getForeHandPlayer()
          Gets the current Forehand player
 boolean getHandDoesBid(int hand)
          Gets the status whether the hand does the bid or not
 int getHighestBidValue()
           
 int getNextBidValue()
           
 boolean getWasAsked(int hand)
           
 void resetBidStatus(int foreHandPlayer)
          Resets the BidStatus to default values at the beginning of the bidding
 void setBidValue(int hand, int newBidValue)
          Sets current bid value for a hand
 void setButtonsEnabled(boolean enabled)
          Enable/Disable the Bidding buttons
 void setHandDoesBid(int hand, boolean handDoesBid)
          Sets the status whether the player does the bid or not
 void setWasAsked(int hand)
           
 
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

BidStatus

public BidStatus()
Creates a new instance of BidStatus

Method Detail

resetBidStatus

public void resetBidStatus(int foreHandPlayer)
Resets the BidStatus to default values at the beginning of the bidding

Parameters:
foreHandPlayer - The ID of the current Forehand player

getForeHandPlayer

public int getForeHandPlayer()
Gets the current Forehand player

Returns:
The ID of the current Forehand player

setButtonsEnabled

public void setButtonsEnabled(boolean enabled)
Enable/Disable the Bidding buttons

Parameters:
enabled - TRUE if the buttons should be enabled otherwise FALSE

getButtonsEnabled

public boolean getButtonsEnabled()
Gets the information whether the buttons are enabled or not

Returns:
TRUE if the Bidding buttons are enabled otherwise FALSE

setHandDoesBid

public void setHandDoesBid(int hand,
                           boolean handDoesBid)
Sets the status whether the player does the bid or not

Parameters:
hand - Which hand should be set (SkatConstants.FORE_HAND, SkatConstants.MIDDLE_HAND, SkatConstants.BACK_HAND)
handDoesBid - TRUE if hand does the bid otherwise FALSE

getHandDoesBid

public boolean getHandDoesBid(int hand)
Gets the status whether the hand does the bid or not

Parameters:
hand - The player that should be asked (SkatConstants.FORE_HAND, SkatConstants.MIDDLE_HAND, SkatConstants.HINDHAND)
Returns:
TRUE if the hand does the bid otherwise FALSE

setBidValue

public void setBidValue(int hand,
                        int newBidValue)
Sets current bid value for a hand

Parameters:
hand - The hand for which the bid value should be set
newBidValue - The new bid value that should be set

getBidValue

public int getBidValue(int hand)
Gets the current bid value for a hand

Parameters:
hand - The hand from where the bid value should be retrieved.
Returns:
The current bid value for this hand

getHighestBidValue

public int getHighestBidValue()

getNextBidValue

public int getNextBidValue()

setWasAsked

public void setWasAsked(int hand)

getWasAsked

public boolean getWasAsked(int hand)