playerlistener.java

来自「手机应用程序之蓝牙编程源代码。。蓝牙编程爱好者课用」· Java 代码 · 共 60 行

JAVA
60
字号
// Copyright (c) 2005 Sony Ericsson Mobile Communications AB
//
// This software is provided "AS IS," without a warranty of any kind. 
// ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, 
// INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A 
// PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. 
//
// THIS SOFTWARE IS COMPLEMENTARY OF JAYWAY AB (www.jayway.se)

package bluegammon.logic;

/**
 * Implementations of this class can be registered in
 * the <code>Player</code> and will receive events upon player actions.
 * @author Peter Andersson
 */
public interface PlayerListener
{
  /** Constant denoting a game exit on user quitting  */
  public static final int LOCAL_QUIT = 0;
  /** Constant denoting a game exit on remote user quitting  */
  public static final int REMOTE_QUIT = 1;
  /** Constant denoting a game exit on local user giving up */
  public static final int LOCAL_GIVE_UP = 2;
  /** Constant denoting a game exit on remote user giving up */
  public static final int REMOTE_GIVE_UP = 3;

  /**
   * Called when a player performs a move.
   * 
   * @param id			Player id.
   * @param moveIndex	The moveindex in possible move array used for move.
   */
  public void moveMade(int id, int moveIndex);
  /**
   * Called when player performs an undo.
   * @param id			Player id.
   */
  public void undoPerformed(int id);
  /**
   * Called when player is finished with his/her turn.
   * @param id			Player id.
   */
  public void turnCommit(int id);
  /**
   * Called when player sent a message.
   * 
   * @param id			Player id.
   * @param msg	The message.
   */
  public void messageSent(int id, char[] msg);
  /**
   * Called when player exits the game for some reason.
   * 
   * @param id			Player id.
   * @param reason	The reason for exiting game.
   */
  public void gameExited(int id, int reason);
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?