game.multiplayer.invitation
Class InvitationImpl

java.lang.Object
  extended by java.rmi.server.RemoteObject
      extended by java.rmi.server.RemoteServer
          extended by java.rmi.server.UnicastRemoteObject
              extended by game.multiplayer.invitation.InvitationImpl
All Implemented Interfaces:
Invitation, java.io.Serializable, java.rmi.Remote

public class InvitationImpl
extends java.rmi.server.UnicastRemoteObject
implements Invitation

This class represents the Invitation Implementation of the Remote Interface for the WordMoleServer.

Author:
Chris Barton
See Also:
Serialized Form

Constructor Summary
InvitationImpl(Invite invite, WordMoleServer server, AsyncCallback callback)
          Constructor
 
Method Summary
 void gameTime(boolean init)
           
 Invite getInvite()
          Returns the current invite.
 void initializeGame(boolean initialize)
          Initializes the game to be created out of the invite and sends it to the server to be processed.
 void makeDecision(Client client, boolean decision)
          Notifies the host of the decision that an invited client has made to either accept of decline.
 boolean ready()
          Returns true if the Invitation is ready and all have accepted, else returns false.
 void setupInvitation()
          Sets up the Invitation.
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, 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
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InvitationImpl

public InvitationImpl(Invite invite,
                      WordMoleServer server,
                      AsyncCallback callback)
               throws java.rmi.RemoteException
Constructor

Parameters:
invite - - Invite that this server is based on.
server - - WordMoleServer main server
callback - - AsyncCallback
Throws:
java.rmi.RemoteException
Method Detail

setupInvitation

public void setupInvitation()
Sets up the Invitation.


initializeGame

public void initializeGame(boolean initialize)
                    throws java.rmi.RemoteException
Description copied from interface: Invitation
Initializes the game to be created out of the invite and sends it to the server to be processed.

Specified by:
initializeGame in interface Invitation
Parameters:
initialize - - boolean - Determines whether or not to start the game or cancel the invite.
Throws:
java.rmi.RemoteException

gameTime

public void gameTime(boolean init)

makeDecision

public void makeDecision(Client client,
                         boolean decision)
                  throws java.rmi.RemoteException
Description copied from interface: Invitation
Notifies the host of the decision that an invited client has made to either accept of decline.

Specified by:
makeDecision in interface Invitation
Parameters:
client - Client - Invitee client.
decision - boolean - Invitee decision for the invite. -> true => Accepts Invite -> false => Declines Invite
Throws:
java.rmi.RemoteException

getInvite

public Invite getInvite()
                 throws java.rmi.RemoteException
Description copied from interface: Invitation
Returns the current invite.

Specified by:
getInvite in interface Invitation
Returns:
Invite
Throws:
java.rmi.RemoteException

ready

public boolean ready()
              throws java.rmi.RemoteException
Description copied from interface: Invitation
Returns true if the Invitation is ready and all have accepted, else returns false.

Specified by:
ready in interface Invitation
Returns:
boolean true => ready; false => not ready.
Throws:
java.rmi.RemoteException