📄 door.java
字号:
/** * Title: 吃豆子<p> * Description: 门<p> * Copyright: Copyright (c) Nothing<p> * Company: Raindrop<p> * @author Nothing * @version 1.0 */package eatbean;import eatbean.util.*;//import java.awt.*;import java.util.*;/** 程序中暂未使用此类,也未完全实现 */public class Door extends MapElement { public static final int BASE_NUM = 10; public static final int STYLE_DEFAULT = BASE_NUM + 1; private static Hashtable styleTable = new Hashtable(); static { styleTable.put(new Integer(STYLE_DEFAULT), "d0.gif"); } private Image img = null; private static Hashtable imgBuffTable = new Hashtable(); public Door(int style, int x, int y) { super(style, x, y); img = getImage(style); } public void parseWidthAndHeight() { width = ELEMENT_MAX_SIZE; height = ELEMENT_MAX_SIZE; } public void draw(OffScreen offScreen) { offScreen.drawImage(img, x, y); } private Image getImage(int imgIndex) { Image result = null; synchronized(imgBuffTable) { // 同步,保证同一个Image不被调入内存两次 result = super.getImage(imgBuffTable, styleTable, imgIndex); } return result; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -