|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--de.kosi.model.TableImpl
This class is the implementation of a KoSI Table.
ChangeLog:
$Log: TableImpl.java,v $ Revision 1.17 2001/08/30 10:44:38 jiriki Finished implementation of claim Revision 1.16 2001/08/23 11:45:36 betacarotine worked on computer player integration Revision 1.15 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.14 2001/08/21 11:23:45 betacarotine continued implementing the computer player integration Revision 1.13 2001/08/21 09:25:52 betacarotine started adding the possibility to start the computer player from the table Revision 1.12 2001/07/20 14:37:08 jiriki Fixed Bug 440605 Revision 1.11 2001/07/13 14:43:35 betacarotine updated documentation Revision 1.10 2001/07/13 14:07:34 betacarotine updated documentation Revision 1.9 2001/07/13 10:49:06 jiriki Started fix for Bugs 440155 and 440333. Revision 1.8 2001/07/04 12:34:30 uid30828 - Rubber score implemented - Inviting now working Revision 1.7 2001/07/04 12:20:56 uid51247 removed a spelling bug in the comments Revision 1.6 2001/07/04 12:17:12 uid51247 now the rubber valuations are available to the clients Revision 1.5 2001/06/22 13:24:32 jiriki Implemented kicking Revision 1.4 2001/05/30 22:22:13 jiriki - Added new files to build file. - Worked on GameView. Revision 1.3 2001/05/09 19:59:18 jiriki Removed Bug 422755. 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.24 2001/04/17 19:30:08 wombat Updated Documentation Revision 1.23 2001/04/11 18:08:14 wombat Client can now write into the table chat. Revision 1.22 2001/04/11 16:54:04 wombat Removed some bugs when joining table and immidiatly leaving again. Revision 1.21 2001/04/11 12:34:32 wombat jar files restructured. Revision 1.20 2001/04/09 13:03:10 wombat Removed timeout from threadpool (did not work) Revision 1.19 2001/03/29 09:49:52 wombat Made createNewGame synchronized. Revision 1.18 2001/03/23 10:48:52 wombat - Table now restarts game - began GuestUser implementation Revision 1.17 2001/03/21 22:34:40 wombat Worked on StressClient, removed bugs in GameImpl/Bidding, improved logging Revision 1.16 2001/03/21 13:26:36 wombat - Removed bugs in Table - began implementation of stree client - updated documentation Revision 1.15 2001/03/19 21:50:49 wombat - Worked on admin client. - improved shutdown sequence - removed bugs in login/logout sequence Revision 1.14 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/kosimovementtestaufgerufen werden) - Tournament und TournamentImpl in das package de.kosi.model.tournament verschoben - buildfile fuer die neuen klassen angepasst Revision 1.13 2001/03/02 09:43:14 wombat Worked on gameimpl Revision 1.12 2001/03/01 21:28:14 wombat Updated TestClient Resolved some bugs Revision 1.11 2001/03/01 20:31:32 wombat Worked on table implementation / updated documentation Revision 1.10 2001/03/01 14:43:00 wombat Worked on table implementation. Revision 1.9 2001/03/01 11:37:25 wombat worked on table implementation. Revision 1.8 2001/02/27 14:43:13 wombat Updated documentation. Revision 1.7 2001/02/26 11:21:45 wombat Worked on table. Revision 1.6 2001/02/21 11:38:46 wombat Worked on GameImpl and Board Revision 1.5 2001/02/20 11:32:17 wombat Started GameImpl implementation. Revision 1.4 2001/02/07 16:54:04 wombat Updated Documentation
Field Summary | |
static java.lang.String[] |
AVAILABLE_COMPUTER_PLAYERS
|
static java.util.Hashtable |
AVAILABLE_COMPUTER_PLAYERS_MAP
|
Constructor Summary | |
TableImpl(DistributedListImpl tablelist,
UserImpl owner,
TableListener ownerTableListener,
int ownerDirection,
boolean publicTable)
Creates a new table. |
Method Summary | |
void |
appealToJudge(java.lang.String reason)
Appeal to a judge. |
void |
destroyed(UserImpl user)
Called when a UserImpl Object is about to be destroyed. |
void |
gameFinished(Result result)
Called by the game when it has just been finished. |
java.util.List |
getAvailableComputerPlayers()
Returns a list of available computer players. |
ChatChannel |
getChatChannel()
Returns the ChatChannel of this table. |
int |
getDirection()
Returns the direction of the calling player. |
Game |
getGame()
Returns the Game currently being played. |
java.lang.String |
getOwner()
Returns the name of the user currently owning this table. |
UserImpl |
getOwningUser()
|
java.lang.String[] |
getPlayerNames()
Returns the Playernames. |
Rubber |
getRubber()
Returns the currently played rubber or the just finished rubber. |
java.lang.String[] |
getWatcherNames()
Returns the users watching this table. |
void |
invitePlayer(java.lang.String name,
int direction)
Invite a Player to the Table. |
void |
joinTable(TableListener tableListener,
int direction)
This method is called to join the table. |
void |
kickPlayer(java.lang.String name)
Remove a Player from the Table. |
void |
leaveTable()
This method is called to leave the table. |
void |
onlineChange(UserImpl user,
boolean isOnline)
This method is called when the online status of the user changes. |
void |
startComputerPlayer(java.lang.String computerPlayer,
int direction)
Starts a computer player that is seated at the given direction. |
void |
watchTable(TableListener tableListener)
This method is called to watch the table. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String[] AVAILABLE_COMPUTER_PLAYERS
public static final java.util.Hashtable AVAILABLE_COMPUTER_PLAYERS_MAP
Constructor Detail |
public TableImpl(DistributedListImpl tablelist, UserImpl owner, TableListener ownerTableListener, int ownerDirection, boolean publicTable) throws java.rmi.RemoteException, InvalidSessionException, TableException, UserAlreadyPlayingException
tablelist
- List of tables. This table has to add itself to this list, after it has been exported for RMI.owner
- Initial owner of this table.ownerTableListener
- TableListener of the owner.ownerDirection
- Position at the Table. This is one of the Player constants (NORTH, SOUTH, EAST, WEST)publicTable
- Wether this table is public.java.rmi.RemoteException
- if the table could not be exported.InvalidSessionException
- when not called from within a valid session context.UserAlreadyPlayingException
- If the owner is already playing.TableException
- if an error occurs while creating the table.Method Detail |
public Rubber getRubber()
getRubber
in interface Table
public ChatChannel getChatChannel()
getChatChannel
in interface Table
public void joinTable(TableListener tableListener, int direction) throws TableException, InvalidSessionException, TableSeatTakenException, UserAlreadyPlayingException, java.rmi.RemoteException
joinTable
in interface Table
tableListener
- listener that is called when the state of the table changes.direction
- Direction the joining user wants to sit in.This is one of the Player constants (NORTH, SOUTH, EAST, WEST).TableException
- if the player cannot jooin the table. Further explanation is contained in the Exception.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.java.rmi.RemoteException
- If exporting the GameImpl was not possible.public void watchTable(TableListener tableListener) throws InvalidSessionException
watchTable
in interface Table
tableListener
- listener that is called when the state of the table changes.InvalidSessionException
- when not called from within a valid session context.public void leaveTable() throws InvalidSessionException
leaveTable
in interface Table
InvalidSessionException
- when not called from within a valid session context.public java.lang.String[] getPlayerNames()
getPlayerNames
in interface Table
public java.lang.String[] getWatcherNames()
getWatcherNames
in interface Table
public java.lang.String getOwner()
getOwner
in interface Table
public UserImpl getOwningUser()
public Game getGame()
getGame
in interface Table
public void kickPlayer(java.lang.String name) throws KosiAccessException, InvalidSessionException
kickPlayer
in interface Table
name
- Name of the player to remove.KosiAccessException
- if not called by the owner of the table.InvalidSessionException
- when not called from within a valid session context.public void invitePlayer(java.lang.String name, int direction) throws KosiAccessException, InvalidSessionException, UserUnavailableException
invitePlayer
in interface Table
name
- Name of the player to remove.KosiAccessException
- If not called by the owner of the table.InvalidSessionException
- If not called from within a valid session context.UserUnavailableException
- If the invited user is not available.public java.util.List getAvailableComputerPlayers()
getAvailableComputerPlayers
in interface Table
public void startComputerPlayer(java.lang.String computerPlayer, int direction) throws KosiAccessException, InvalidSessionException, ComputerPlayerException
startComputerPlayer
in interface Table
computerPlayer
- The name of the computer player.direction
- The direction the computer player is seated at.KosiAccessException
- If not called by the table owner.InvalidSessionException
- If called from an invalid
session context.java.lang.ClassNotFoundException
- If the given computer player
class name does not represent a valid class.public int getDirection() throws KosiAccessException, InvalidSessionException
getDirection
in interface Table
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.public void onlineChange(UserImpl user, boolean isOnline)
onlineChange
in interface UserListener
user
- user whose state changed.isOnline
- wether the user is online.public void destroyed(UserImpl user)
destroyed
in interface UserListener
user
- UserImpl object to be destroyed.public void gameFinished(Result result)
GameContainer
gameFinished
in interface GameContainer
de.kosi.model.game.GameContainer
result
- The result of the game.public void appealToJudge(java.lang.String reason)
appealToJudge
in interface GameContainer
reason
- Reason for calling a judge.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |