- 3
- 0
- 约1.49万字
- 约 19页
- 2019-08-10 发布于江西
- 举报
//盘类 Disk.java
package towers;
import java.awt.*;
public class Disk extends Button {
/**
* 当前Disk对象编号
*/
int number;
/**
* 当前盘上是否有盘
*/
boolean hasDiskUpstairs = false;
/**
* 初始化一个Disk对象
* @param number
* @param tower
*/
public Disk(int number, Tower tower) {
this.number = number;
setBackground(Color.BLUE);
addMouseMotionListener(tower);
addMouseListener(tower);
}
/**
* 获取是否当前盘的上方有盘属性
* @return
*/
public boolean getHasDiskUpstairs() {
return hasDiskUpstairs;
}
/**
* 设置当前盘上是否还有盘属性
* @param b
*/
public void setHasDiskUpstairs(boolean b) {
hasDiskUpstairs = b;
}
/**
* 获取当前盘的编号
* @return
*/
public int getNumber() {
return number;
}
}
//游戏配置类 GameConfig.java
package towers;
public class GameConfig {
/**
* 盘子总数
*/
private int totalDisk;
/**
* 最大盘的宽度
*/
private int diskWidth;
/**
* 最大盘的高度
*/
private int diskHeight;
/**
* 游戏主窗口高度
*/
private int mainFrameHeight;
/**
* 游戏主窗口宽度
*/
private int mainFrameWidth;
/**
* 游戏面板宽度
*/
private int gamePanelWidth;
/**
* 游戏面板高度
*/
private int gamePanelHeight;
/**
* @return the diskHeight
*/
public int getDiskHeight() {
return diskHeight;
}
/**
* @return the diskWidth
*/
public int getDiskWidth() {
return diskWidth;
}
/**
* @return the gamePanelHeight
*/
public int getGamePanelHeight() {
return gamePanelHeight;
}
/**
* @return the gamePanelWidth
*/
public int getGamePanelWidth() {
return gamePanelWidth;
}
/**
* @return the mainFrameHeight
*/
public int getMainFrameHeight() {
return mainFrameHeight;
}
/**
* @return the mainFrameWidth
*/
public int getMainFrameWidth() {
return mainFrameWidth;
}
/**
* @return the totalDisk
*/
public int getTotalDisk() {
return totalDisk;
}
/**
* @param diskHeight the diskHeight to set
*/
public void setDiskHeight(int diskHeight) {
this.diskHeight = diskHeight;
}
/**
* @param diskWidth the diskWidth to set
您可能关注的文档
- CutMax激光切割软件用户手册.doc
- C语言程序设计案例教程 李培金第13章 Turbo C V2.0综合应用.ppt
- C语言课程设计报告--飞机订票系统.doc
- DBT公司工作面运输机CST技术.doc
- DCS基本知识培训课件.ppt
- Development of Beidou and Civil Aviation Consideration and - ICAO发展北斗和民用航空和国际民航组织的思考.ppt
- DF老年公寓-养生案例研究-5-3世界五大养生名城之“美国太阳城”.ppt
- DHA与婴儿脑部发育.ppt
- DM单发放技巧文章.doc
- doc七年级英语上册 Unit 5 Do you have a soccer ball单元测试卷 人教新目标版.doc
原创力文档

文档评论(0)