de.kosi.model.game
Class Board

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

public class Board
extends java.lang.Object
implements java.io.Serializable

This class represents a board of cards. It contains informations about the cards, wether or not North, East, South and West are in danger and who is the opener of this board.

ChangeLog:

 
 $Log: Board.java,v $
 Revision 1.2  2001/06/15 14:20:30  jiriki
 Trying to Display result

 Revision 1.1.1.1  2001/04/29 18:05:18  jiriki
 Imported sources from zola.

 Revision 1.9  2001/04/26 09:17:39  login
 Wrote a test case for the de.kosi.model.game.Board

 Revision 1.8  2001/03/27 14:50:59  timo
 Removed Copy & Paste Error
 Replaced NorthSouth with EastWest

 Revision 1.7  2001/03/23 10:48:52  wombat
 - Table now restarts game
 - began GuestUser implementation

 Revision 1.6  2001/03/21 22:34:40  wombat
 Worked on StressClient, removed bugs in GameImpl/Bidding, improved logging

 Revision 1.5  2001/03/15 19:19:48  login
 Worked on GameImpl to make it possible that the declarer plays the dummy's cards
 and prohibit that the dummy does anything.

 Revision 1.4  2001/03/05 20:55:22  login
 - Game (und zugehoerige Klassen) soweit fertig
 - package de.kosi.model.tournament angelegt
 - Pair angelegt
 - Round angelegt
 - Movement-Interface angelegt
 - KosiMovement fertig!!! :-)
 - KosiMovementTest um das KosiMovement zu testen
       (kann mit KOSI/kosimovementtest  aufgerufen werden)
 - Tournament und TournamentImpl in das package de.kosi.model.tournament
       verschoben
 - buildfile fuer die neuen klassen angepasst

 Revision 1.3  2001/02/27 14:43:14  wombat
 Updated documentation.

 Revision 1.2  2001/02/26 15:21:37  wombat
 worked on GamImpl and Board

 Revision 1.1  2001/02/21 11:38:47  wombat
 Worked on GameImpl and Board

 

Version:
$Revision: 1.2 $ ($Date: 2001/06/15 14:20:30 $)
Author:
Timo, Niklas, Ole
See Also:
Serialized Form

Constructor Summary
Board()
          Creates a new random Board.
Board(Board board)
          Creates a successor board.
 
Method Summary
 java.util.Vector getCards(int direction)
          Return the cards for one direction.
 int getOpener()
          Return the opener of this board.
 boolean isVulnerableEastWest()
          Returns if East and West are vulnerable.
 boolean isVulnerableNorthSouth()
          Returns if North and South are vulnerable.
 java.lang.String toString()
          Returns a string representation of the board.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Board

public Board()
Creates a new random Board.

Board

public Board(Board board)
Creates a successor board. The opener and danger rotate.
Parameters:
board - board this board is the successor to.
Method Detail

getCards

public java.util.Vector getCards(int direction)
Return the cards for one direction.
Parameters:
direction - one of the player constants NORTH, EAST, SOUTH, WEST.
Returns:
Vector containing Card objects.
Throws:
java.lang.IllegalArgumentException - If the direction argument was no valid direction constant.

getOpener

public int getOpener()
Return the opener of this board.
Returns:
one of the player constants NORTH, EAST, SOUTH, WEST.

isVulnerableNorthSouth

public boolean isVulnerableNorthSouth()
Returns if North and South are vulnerable.
Returns:
true if Norht and South are vulnerable.

isVulnerableEastWest

public boolean isVulnerableEastWest()
Returns if East and West are vulnerable.
Returns:
true if East and West are vulnerable.

toString

public java.lang.String toString()
Returns a string representation of the board.
Overrides:
toString in class java.lang.Object
Returns:
a String representation.