au.com.solidsoftware.multimahjong.shared
Class PlayersObserver

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--java.rmi.server.RemoteServer
              |
              +--java.rmi.server.UnicastRemoteObject
                    |
                    +--au.com.solidsoftware.multimahjong.shared.Observer
                          |
                          +--au.com.solidsoftware.multimahjong.shared.PlayersObserver

public class PlayersObserver
extends Observer

PlayersObserver extends the Observer class and keeps the MultiGameStarter updated about any players that have joined the game that was created. It is created by the MultiGameStarter and passed to the RemoteReferee when the MultiGameStarter creates the game. The RemoteReferee then uses this class to update the MultiGameStarter when changes to the list of players occur.

Author:
Michael Hart
See Also:
MultiGameStarter, RemoteReferee, Serialized Form

Field Summary
private  MultiGameStarter parent
          This is a reference to the MultiGameStarter that is passed in when this class is instantiated.
 
Fields inherited from class au.com.solidsoftware.multimahjong.shared.Observer
game
 
Fields inherited from class java.rmi.server.UnicastRemoteObject
csf, port, portFactoryParamTypes, portParamTypes, serialVersionUID, ssf
 
Fields inherited from class java.rmi.server.RemoteServer
log, logname, serialVersionUID
 
Fields inherited from class java.rmi.server.RemoteObject
ref, serialVersionUID
 
Constructor Summary
PlayersObserver(MultiGameStarter parent)
          Sets the local variable parent.
 
Method Summary
 void addPlayer(java.lang.String name, int playerID)
          Calls a method in the MultiGameStarter to add a player to the list.
 
Methods inherited from class au.com.solidsoftware.multimahjong.shared.Observer
addGame, exitGame, placePlayerAction, placeResult, placeRobResult, removeGame, setGame, updateWaiting
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
, clone, exportObject, exportObject, exportObject, exportObject, readObject, reexport, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub, writeObject
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

parent

private MultiGameStarter parent
This is a reference to the MultiGameStarter that is passed in when this class is instantiated.
Constructor Detail

PlayersObserver

public PlayersObserver(MultiGameStarter parent)
                throws java.rmi.RemoteException
Sets the local variable parent.
Parameters:
parent - the MultiGameStarter to contact with updates
See Also:
MultiGameStarter
Method Detail

addPlayer

public void addPlayer(java.lang.String name,
                      int playerID)
               throws java.rmi.RemoteException
Calls a method in the MultiGameStarter to add a player to the list.
Parameters:
name - the name of the player who created the game
playerID - the ID of the newly created game
Overrides:
addPlayer in class Observer
See Also:
MultiGameJoiner