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

📄 nextboard.java

📁 SWT编写的俄罗期方块
💻 JAVA
字号:
/* 
 * $Id: NextBoard.java, 2007-10-11, 下午05:07:18, Eric. Exp$
 *
 * Copyright (c) 2006-2007 Wipro Technologies. All Rights Reserved.
 * This software program and documentation are copyrighted by Wipro 
 * Technologies.
 */
package eric.block;

import org.eclipse.swt.widgets.Display;

/**
 * Class/Interface description
 *
 * @author Eric  
 * @see Another Class 
 * @since 0.1
 */
public class NextBoard
{
	private int currentBlockType;
	
	private int nextBlockType;
	
	private Display display;
	
	private Block currentBlock;
	
	private Block nextBlock;
	
	/**
	 * @param currentBlockType
	 * @param nextBlockType
	 * @param display
	 */
	public NextBoard(int currentBlockType, int nextBlockType, Display display){	
		
		this.display = display;
		
		this.currentBlockType = currentBlockType;
		this.nextBlockType = nextBlockType;
		
	}
	
	
	/**
	 * @param display
	 */
	public NextBoard(Display display){	
		
		this.display = display;
	}
	
	/**
	 * @return Block
	 */
	public Block getCurrentBlock(){
		this.currentBlock = new Block(60, 60 ,currentBlockType, display);
		return currentBlock;
	}
	
	/**
	 * @param blockType
	 */
	public void setCurrentBlock(int blockType){
		this.currentBlockType = blockType;
	}
	
	/**
	 * @return Block
	 */
	public Block getNextBlock(){
		this.nextBlock = new Block(60, 60, nextBlockType, display);
		return nextBlock;
	}
	
	/**
	 * @param blockType
	 */
	public void setNextBlock(int blockType){
		this.nextBlockType = blockType;
	}
	
	/**
	 * draw next block.
	 */
	public void draw(){

		getCurrentBlock().clear();
		getNextBlock().draw();

	}
	
	/**
	 * clear current block
	 */
	public void clear(){

		getNextBlock().clear();

	}
}

⌨️ 快捷键说明

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