View Javadoc

1   // START LICENSE
2   // JSet - a Java JSet card board game implementation
3   // Copyright (C) 2004 Jerome Lacoste
4   //
5   // This program is free software; you can redistribute it and/or modify
6   // it under the terms of the GNU General Public License as published by
7   // the Free Software Foundation; either version 2 of the License, or (at
8   // your option) any later version.
9   //
10  // This program is distributed in the hope that it will be useful, but
11  // WITHOUT ANY WARRANTY; without even the implied warranty of
12  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  // General Public License for more details.
14  //
15  // You should have received a copy of the GNU General Public License
16  // along with this program; if not, write to the Free Software
17  // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18  // END LICENSE
19  
20  package org.cb.jset.server;
21  
22  import java.rmi.Remote;
23  import java.rmi.RemoteException;
24  
25  /***
26   * Interface for the clients to play remotely a jset game.
27   * Defines the callbacks hooks made from the RemoteSetGame implementation to the remote client
28   * implementing this interface.
29   * <p>
30   * @see RemoteSetGame#connect(org.cb.jset.server.RemoteSetGamePlayer)
31   * @author jerome@coffeebreaks.org - last modified by $LastChangedBy: jerome $
32   * @version $Id: RemoteSetGamePlayer.java 118 2004-04-14 23:17:27Z jerome $
33   */
34  public interface RemoteSetGamePlayer extends Remote, org.cb.jset.server.RemoteSetGameBoardListener
35  {
36    /***
37     * @return the name of the player.
38     * @throws java.rmi.RemoteException upon communication related exception on this remote call
39     * @see org.cb.jset.SetGamePlayer#getName()
40     */
41    String getName() throws RemoteException;
42  
43    /***
44     * Called by a game when the player should be blocked.
45     * @throws java.rmi.RemoteException upon communication related exception on this remote call
46     * @see org.cb.jset.SetGamePlayer#block()
47     */
48    void block() throws RemoteException;
49  
50    /***
51     * Called by a game when the player should be unblocked.
52     * @throws java.rmi.RemoteException upon communication related exception on this remote call
53     * @see org.cb.jset.SetGamePlayer#unblock()
54     */
55    void unblock() throws RemoteException;
56  
57    /***
58     * A blocked player doesn't have the right to play.
59     * @return <code>true</code> is the player is blocked, <code>false</code> otherwise.
60     * @throws java.rmi.RemoteException upon communication related exception on this remote call
61     * @see org.cb.jset.SetGamePlayer#isBlocked()
62     */
63    boolean isBlocked() throws RemoteException;
64  
65    /***
66     * Called to notify a disconnection from a game.
67     * @throws java.rmi.RemoteException upon communication related exception on this remote call
68     * @see org.cb.jset.SetGamePlayer#disconnect()
69     */
70    void disconnect() throws RemoteException;
71  }