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;
21  
22  /***
23   * Interface that players of a game must implement.
24   * <p>
25   * A player automatically listens to the board. There's no point otherwise.
26   *
27   * @author jerome@coffeebreaks.org - last modified by $LastChangedBy: jerome $
28   * @version $Id: SetGamePlayer.java 130 2004-04-15 05:18:07Z jerome $
29   */
30  public interface SetGamePlayer extends SetGameBoardListener
31  {
32    /***
33     * @return the name of the player.
34     */
35    String getName();
36  
37    /***
38     * Called by a game when the player should be blocked.
39     * @see #isBlocked()
40     */
41    void block();
42  
43    /***
44     * Called by a game when the player should be unblocked.
45     * @see #isBlocked()
46     */
47    void unblock();
48  
49    /***
50     * A blocked player doesn't have the right to play.
51     * @return <code>true</code> is the player is blocked, <code>false</code> otherwise. 
52     */
53    boolean isBlocked();
54  
55    /***
56     * Called to notify a disconnection from a game.
57     */
58    void disconnect();
59  }