📄 playerlistener.java
字号:
// 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -