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

📄 pieces.java

📁 一个简单的Java Swing 游戏Blokus~方块圈地~Eclipse3.0 Project
💻 JAVA
字号:
/*
 * 创建日期 2005-4-10
 *
 * TODO 要更改此生成的文件的模板,请转至
 * 窗口 - 首选项 - Java - 代码样式 - 代码模板
 */
package frame;

import java.awt.Image;

/**
 * @author Robert
 *
 * TODO 要更改此生成的类型注释的模板,请转至
 * 窗口 - 首选项 - Java - 代码样式 - 代码模板
 */
public class Pieces {
	private Image piece;
	private int pColor,typeNo,score;
	private int[][] grid;
	private int[][] bak;
	private boolean onBoard = false;
	private boolean selected = false;
	private boolean inUse = true;
	
	public Pieces(Image piece,int typeNo,int pColor, int score,int[][] grid){
		this.piece = piece;
		this.pColor = pColor;
		this.typeNo = typeNo;
		this.score = score;
		this.grid = grid;
		this.bak = new int[score][score];
		for(int i = 0; i < score; i ++)
			for(int j = 0; j < score; j ++)
				bak[i][j] = grid[i][j];
	}
	
	public int getScore(){
		return score;
	}
	
	public Image getPiece(){
		return piece;
	}
	
	public int getpColor(){
		return pColor;
	}
	
	public int getTypeNo(){
		return typeNo;
	}
	
	public boolean getOnBoard(){
		return onBoard;
	}
	
	public void setOnBoard(boolean onBoard){
		this.onBoard = onBoard;
	}
	
	public void setPSelected(boolean selected){
		this.selected = selected;
	}
	
	public boolean getPSelected(){
		return selected;
	}
	
	public int[][] getGrid(){
		return grid;
	}
	
	public void setGrid(int[][] grid){
		this.grid = grid;
	}
	
	public int[][] getBak(){
		return bak;
	}
	
	public boolean getInUse(){
		return inUse;
	}
	
	public void setInUse(boolean inUse){
		this.inUse = inUse;
	}
}

⌨️ 快捷键说明

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