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

📄 rrbeelementfactory.java

📁 RoboRally Board editor 是一个用来创建战棋类游戏的Java程序。
💻 JAVA
字号:
import javax.swing.*;import java.awt.*;import java.awt.image.*;public class RRBEElementFactory{    protected RRBEMainWindow window;    public ImageIcon[] images;    public String name;    public int level;    public boolean requireWall;    public boolean scaleToWall;    public String typeId;    public RRBEElementFactory() {    }    public RRBEElementFactory(String typeId			      , RRBEMainWindow w			      , String name			      , String imageName			      , int level			      , boolean wall			      , boolean scaleToWall) {	init(typeId, w, name, imageName	     , level, wall, scaleToWall);    }    private void init(String typeId,		      RRBEMainWindow w		      , String name		      , String imageName		      , int level		      , boolean wall		      , boolean scaleToWall) {	this.typeId = typeId;	window = w;	this.images = new ImageIcon[4];	this.images[0] = new ImageIcon(RRBEGlobal.curthemepath + imageName);	for (int i = 0; i < 3; i++)	  this.images[i+1] = rotateImage(this.images[i]);	this.name = name;	this.level = level;	requireWall = wall;	this.scaleToWall = scaleToWall;    }    public ImageIcon rotateImage(ImageIcon image) {	return RRBEGlobal.rotateImage(image, window);	    }    public void activate(RRBESquare s) {	RRBEElement e = createElement();	s.addElement(e);	    }    public String toString() {	return name + " (" + typeId + ")";    }    public ImageIcon getToolBarIcon() {	return new ImageIcon(images[window.currentRotation()].getImage()			 .getScaledInstance(RRBEGlobal.toolButtonIconWidth					    ,RRBEGlobal.toolButtonIconHeight					    ,Image.SCALE_SMOOTH));    }    public ImageIcon getSmallIcon() {	return new ImageIcon(images[window.currentRotation()].getImage()			 .getScaledInstance(RRBEGlobal.smallToolButtonIconWidth					    ,RRBEGlobal					    .smallToolButtonIconHeight					    ,Image.SCALE_SMOOTH));    }    public RRBEElement createElement() {	RRBEElement e = new RRBEElement(typeId, name, level, images					, window.currentRotation()					, requireWall					, scaleToWall);	for (int i = 0; i < 5; i++)	    e.setActivePhase(i,false);	return e;    }}

⌨️ 快捷键说明

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