|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface gives access to the methods of a table
representation. That is the place where the Bridge games take
place. At each table should only one game of Bridge take place
simultaneously. Before the game takes place there can be one, two
or three players be waiting at the table for the missing
participants. If four players have arrived at the table, it must
create a new Game instance to let the players play it.
Users can also be allowed to watch a table so the table must manage
a list of players (e.g. using the de.kosi.model.game.Players class)
and a list of watchers.
Every user can create a table where a game of Bridge can take
place. The creator of the Table should become the owner of the
table which is a special user who is allowed to invite other users
to this table or kick other users from this table.
To let the players and possibly also the watchers talk to the
others a Table should provide a chat channel.
ChangeLog:
$Log: Table.java,v $ Revision 1.7 2001/08/21 14:15:22 betacarotine the computer player should be startable from the table now, but is not automatically removed from memory... Revision 1.6 2001/08/21 11:23:45 betacarotine continued implementing the computer player integration Revision 1.5 2001/08/21 09:25:52 betacarotine started adding the possibility to start the computer player from the table Revision 1.4 2001/07/04 12:34:30 uid30828 - Rubber score implemented - Inviting now working Revision 1.3 2001/07/04 12:17:12 uid51247 now the rubber valuations are available to the clients Revision 1.2 2001/05/09 11:44:40 betacarotine The Table interface got a getDirection method that returns the direction of the calling user. Revision 1.1.1.1 2001/04/29 18:05:17 jiriki Imported sources from zola. Revision 1.11 2001/03/19 21:50:49 wombat - Worked on admin client. - improved shutdown sequence - removed bugs in login/logout sequence Revision 1.10 2001/03/01 20:31:32 wombat Worked on table implementation / updated documentation Revision 1.9 2001/03/01 14:43:00 wombat Worked on table implementation. Revision 1.8 2001/03/01 11:37:25 wombat worked on table implementation. Revision 1.7 2001/02/27 14:43:13 wombat Updated documentation. Revision 1.6 2001/02/26 11:21:45 wombat Worked on table. Revision 1.5 2001/02/11 17:49:29 login documented de.kosi.model.Table Revision 1.4 2001/02/11 17:21:33 login started documenting
Method Summary | |
java.util.List |
getAvailableComputerPlayers()
Returns a list of available computer players. |
ChatChannel |
getChatChannel()
Returns the chat channel of this table where the players can communicate. |
int |
getDirection()
Returns the direction of the calling player. |
Game |
getGame()
Returns the game of Bridge that takes place at this table or null if there is currently no game played. |
java.lang.String |
getOwner()
Returns the name of the table's owner. |
java.lang.String[] |
getPlayerNames()
Returns an array of Strings representing the players. |
Rubber |
getRubber()
Returns the currently played rubber or the just finished rubber. |
java.lang.String[] |
getWatcherNames()
Returns an array containing the names of all watchers at this table. |
void |
invitePlayer(java.lang.String name,
int direction)
Invites a player to this table. |
void |
joinTable(TableListener tableListener,
int direction)
A client can call this method to join this table. |
void |
kickPlayer(java.lang.String name)
Kicks a player from the table. |
void |
leaveTable()
This method should be called to leave the table. |
void |
startComputerPlayer(java.lang.String computerPlayer,
int direction)
Starts a computer player that is seated at the given direction. |
void |
watchTable(TableListener tableListener)
Call this method to watch the table. |
Method Detail |
public ChatChannel getChatChannel() throws java.rmi.RemoteException
java.rmi.RemoteException
- If the remote call of this method
fails.public Rubber getRubber() throws java.rmi.RemoteException
public void joinTable(TableListener tableListener, int direction) throws java.rmi.RemoteException, TableException, InvalidSessionException, UserAlreadyPlayingException, TableSeatTakenException
tableListener
- A listener that will be notified of events
at the table.direction
- The direction of the player. Its value must be
Player.NORTH, Player.EAST, Player.SOUTH or Player.WEST.java.rmi.RemoteException
- If the remote call fails.TableException
- If the table cannot be joined.InvalidSessionException
- when not called from within a valid session context.UserAlreadyPlayingException
- If the user calling this method is already playing.TableSeatTakenException
- If the seat in direction is already taken.public void watchTable(TableListener tableListener) throws java.rmi.RemoteException, InvalidSessionException
tableListener
- A listener that will be notified of events
regarding this table.java.rmi.RemoteException
- If RMI runs into trouble.InvalidSessionException
- when not called from within a valid session context.public void leaveTable() throws java.rmi.RemoteException, InvalidSessionException
java.rmi.RemoteException
- If the remote call of this method
fails.InvalidSessionException
- when not called from within a valid session context.public java.lang.String[] getPlayerNames() throws java.rmi.RemoteException
java.rmi.RemoteException
- If the remote call fails.public java.lang.String[] getWatcherNames() throws java.rmi.RemoteException
java.rmi.RemoteException
- If the remote call fails.public java.lang.String getOwner() throws java.rmi.RemoteException
java.rmi.RemoteException
- If the remote call fails.public Game getGame() throws java.rmi.RemoteException
java.rmi.RemoteException
- If RMI runs into trouble.public void kickPlayer(java.lang.String name) throws java.rmi.RemoteException, KosiAccessException, InvalidSessionException
name
- The name of the player that is to be kicked.java.rmi.RemoteException
- If the remote call fails.KosiAccessException
- When not called by the owner of the table.InvalidSessionException
- When not called from within a valid session context.
owner of the table.public java.util.List getAvailableComputerPlayers() throws java.rmi.RemoteException
java.rmi.RemoteException
- Guess...public void startComputerPlayer(java.lang.String computerPlayer, int direction) throws java.rmi.RemoteException, KosiAccessException, InvalidSessionException, ComputerPlayerException
computerPlayer
- Class name of the desired computer player.direction
- The direction the computer player is seated at.java.rmi.RemoteException
- If the remote call failed.KosiAccessException
- If not called by the table owner.InvalidSessionException
- If called from an invalid
session context.public void invitePlayer(java.lang.String name, int direction) throws java.rmi.RemoteException, KosiAccessException, InvalidSessionException, UserUnavailableException
name
- The name of the user that is to be invited.java.rmi.RemoteException
- If the remote call fails.KosiAccessException
- If the caller of this method is not the
owner of the table.InvalidSessionException
- When not called from within a valid session context.UserUnavailableException
- If the invited user is not available.public int getDirection() throws KosiAccessException, InvalidSessionException, java.rmi.RemoteException
KosiAccessException
- if the player is not currently seated at this gameInvalidSessionException
- if not called from a valid session context.
and therefor has no direction assigned.java.rmi.RemoteException
- If the RMI call fails.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |