dicesnewturnanim.java
来自「手机应用程序之蓝牙编程源代码。。蓝牙编程爱好者课用」· Java 代码 · 共 57 行
JAVA
57 行
// 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.gui.animation;
import bluegammon.gui.BoardCanvas;
/**
* Animation of a player throwing his or her two dices at
* the start of a new turn.
*
* @author Peter Andersson
*/
public class DicesNewTurnAnim extends AbstractDicesAnim
{
/**
* Creates a new animation on a new turn, throws two dices
* of the same color.
* @param dicesWhite True if dices should be white, false otherwise.
* @param dice1 Value of first dice (1-6).
* @param dice2 Value of second dice (1-6).
*/
public DicesNewTurnAnim(boolean dicesWhite, int dice1, int dice2)
{
super(dicesWhite, dicesWhite, dice1, dice2);
}
/**
* Prevents interacton and disables drawing of dicevalues.
*/
public void onStart()
{
super.onStart();
BoardCanvas.getInstance().allowInteraction(false);
BoardCanvas.getInstance().setDrawDiceValues(false);
}
/**
* Updates cursor, enables interaction and start
* drawing the dicevalues.
*/
public void onExit()
{
super.onExit();
BoardCanvas.getInstance().cursorNearestIndex(0,0);
BoardCanvas.getInstance().allowInteraction(true);
BoardCanvas.getInstance().setDrawDiceValues(true);
BoardCanvas.getInstance().updateCursor();
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?