⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 boardstatelistener.java

📁 --- --- --- 基于J2ME的游戏程序--------很有技巧性的程序
💻 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 interface can be registered in
 * the <code>BoardState</code> and will receive events when the state changes.
 * <code>BoardStateListener</code> is used for low-level reports when pieces should
 * be moved on a gui, etc.
 * 
 * @author Peter Andersson
 */
public interface BoardStateListener
{
    /**
     * Called from BoardState when turn changes.
     * 
     * @param whiteTurn	true if white turn, false if black.
     */
  	public void turnChange(boolean whiteTurn);
  	/**
  	 * Called from BoardState whenever a piece is moved.
  	 * 
  	 * @param white	true if white piece, false otherwise
  	 * @param from	piece source index
  	 * @param to	piece destination index
  	 */
	public void pieceMoved(boolean white, int from, int to);
	/**
	 * Called from BoardState when a possible undo has been added
	 * 
	 * @param undos	Number of current undos
	 * @param diceValue	The dice value that can be used for undo (1-6)
	 */
	public void undoAdded(int undos, int diceValue);
	/**
	 * Called from BoardState when an undo is performed.
	 * 
	 * @param undos		Number of current undos
	 * @param diceValue	The dice value that was used for undo (1-6)
	 */
	public void undoPerformed(int undos, int diceValue);
	/**
	 * Called from BoardState when a game is finished
	 * 
	 * @param whiteWinner			True if white player wins, false if black player wins
	 * @param loserPiecesLeft		Total number of loser pieces left 
	 * @param points				Point per piece
	 */
	public void gameFinished(boolean whiteWinner, int loserPiecesLeft, int points);
}

⌨️ 快捷键说明

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