de.kosi.model.game
Class NormalResult

java.lang.Object
  |
  +--de.kosi.model.game.Result
        |
        +--de.kosi.model.game.NormalResult
All Implemented Interfaces:
java.io.Serializable

public class NormalResult
extends Result

This class is used as result for games that have been finished normally (it got finished after the 13 tricks had been played, time was not exceeded).

ChangeLog:

 $Log: NormalResult.java,v $
 Revision 1.9  2001/06/27 11:53:21  betacarotine
 Worked on the Rubber and added comments.

 Revision 1.8  2001/06/22 14:16:01  betacarotine
 Improved result handling

 Revision 1.7  2001/06/15 13:07:03  betacarotine
 added serial version UIDs to the Result-classes.

 Revision 1.6  2001/06/15 09:33:27  betacarotine
 Changed the Game-interface. Instead of
 	int getLatestLeader()   and
 	List getLatestTrick()
 we now have
 	Trick getLatestTrick()

 The internal representation and storage of the tricks is reimplemented too
 based on the new Trick-class.

 Revision 1.5  2001/06/13 12:30:05  jiriki
 Worked on Game/TableView

 Revision 1.4  2001/06/06 09:22:35  betacarotine
 updated documentation

 Revision 1.3  2001/06/01 15:07:07  betacarotine
 Updated documentation

 Revision 1.2  2001/06/01 14:49:54  betacarotine
 improved the result handling, added tournament scoring

 Revision 1.1  2001/05/25 14:51:23  betacarotine
 Added a result handling mechanism for the game.


 

Version:
$Revision: 1.9 $ ($Date: 2001/06/27 11:53:21 $)
Author:
PG KoSI, Fachbereich Informatik, Universitaet Oldenburg
See Also:
Serialized Form

Field Summary
static long serialVersionUID
          The serial version UID
 
Constructor Summary
NormalResult(Board board, java.util.List bids, SuitContract contract, java.util.List tricks, int trickCounter)
          Creates a new NormalResult instance.
 
Method Summary
 boolean declarerVulnerable()
          Checks if the declarer is vulnerable.
 boolean declarerWon()
          Checks if the declarer made the contract.
 int getDeclarerTricks()
          Returns the tricks that the declarer made.
 int getOverTricks()
          Returns the number of overtricks that the declarer made.
 int getRubberAboveEastWest()
          Returns the points that EastWest gets for this board above the line when playing Rubberbridge.
 int getRubberAboveNorthSouth()
          Returns the points that NorthSouth gets for this board above the line when playing Rubberbridge.
 int getRubberBelowEastWest()
          Returns the points that EastWest gets for this board below the line when playing Rubberbridge.
 int getRubberBelowNorthSouth()
          Returns the points that NorthSouth gets for this board below the line when playing Rubberbridge.
 SuitContract getSuitContract()
          Returns the contract of the game with correct type SuitContract.
 int getTournamentScore()
          Calculates the points that the declarer gets according to the bridge scoring rules for Tournaments.
 int getUnderTricks()
          Returns the number of undertricks that the declarer made.
 
Methods inherited from class de.kosi.model.game.Result
getBids, getBoard, getContract, getTricks
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

public static final long serialVersionUID
The serial version UID
Constructor Detail

NormalResult

public NormalResult(Board board,
                    java.util.List bids,
                    SuitContract contract,
                    java.util.List tricks,
                    int trickCounter)
Creates a new NormalResult instance.
Parameters:
board - The board that was played on.
bids - The list of bids that were bid in the bidding phase.
contract - The contract of the game.
tricks - The list cards that were played in the playing phase.
trickCounter - The number of tricks that the declarer made.
Method Detail

getOverTricks

public int getOverTricks()
Returns the number of overtricks that the declarer made. If he didn't make the contract, the result is negative.
Returns:
The number of overtricks that the declarer made.

getUnderTricks

public int getUnderTricks()
Returns the number of undertricks that the declarer made. If he made the contract, the result is negative or zero.
Returns:
The number of undertricks that the declarer made.

getDeclarerTricks

public int getDeclarerTricks()
Returns the tricks that the declarer made.
Returns:
The number of tricks that the declarer made.

getSuitContract

public SuitContract getSuitContract()
Returns the contract of the game with correct type SuitContract.
Returns:
The contract of the game.

declarerWon

public boolean declarerWon()
Checks if the declarer made the contract.
Returns:
true if the declarer made the contract, otherwise false

declarerVulnerable

public boolean declarerVulnerable()
Checks if the declarer is vulnerable.
Returns:
true if the declarer is vulnerable, otherwise false

getTournamentScore

public int getTournamentScore()
Calculates the points that the declarer gets according to the bridge scoring rules for Tournaments. The result of this function is positive if the declarer made the contract, otherwise it is negative.
Returns:
The points that the declarer made.

getRubberAboveNorthSouth

public int getRubberAboveNorthSouth()
Returns the points that NorthSouth gets for this board above the line when playing Rubberbridge. In Rubberbridge you get points above the line when making a contract with bonus points (overtricks, slam, insult) or when the opponents do not make their contract. In both cases you get a bonus for holding 4 or 5 honors in one hand.
Returns:
The Points above the line for NorthSouth in Rubberbridge.

getRubberAboveEastWest

public int getRubberAboveEastWest()
Returns the points that EastWest gets for this board above the line when playing Rubberbridge. In Rubberbridge you get points above the line when making a contract with bonus points (overtricks, slam, insult) or when the opponents do not make their contract. In both cases you get a bonus for holding 4 or 5 honors in one hand.
Returns:
The Points above the line for EastWest in Rubberbridge.

getRubberBelowNorthSouth

public int getRubberBelowNorthSouth()
Returns the points that NorthSouth gets for this board below the line when playing Rubberbridge. In Rubberbridge you get points below the line only when making a contract.
Returns:
The points below the line for NorthSouth when playing Rubberbridge.

getRubberBelowEastWest

public int getRubberBelowEastWest()
Returns the points that EastWest gets for this board below the line when playing Rubberbridge. In Rubberbridge you get points below the line only when making a contract.
Returns:
The points below the line for EastWest when playing Rubberbridge.