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

📄 simplelevel.java

📁 j2me游戏引擎 j2me游戏引擎
💻 JAVA
字号:
package cn.org.matrix.gmatrix.gameLab.scene;

import java.util.Vector;

import cn.org.matrix.gmatrix.gameLab.GameObject;
import cn.org.matrix.gmatrix.gameLab.GameObjectQueue;
/**
 * 游戏世界:有多个map组成的大型关卡
 * @author cleverpig
 *
 */
public class SimpleLevel extends GameObject{
	//关卡名称
	private String levelName=null;
	//关卡中用到的地图,使用Map的id作为主键,以便MapTransformer查找
	private GameObjectQueue mapSet=null;
	//关卡中第一个地图的ID
	private String firstMapID=null;
	
	public SimpleLevel(){
		super();
	}
	
	public void loadProperties(Vector v){
		this.setId((String)v.elementAt(0));
		this.levelName=(String)v.elementAt(1);
		this.firstMapID=(String)v.elementAt(2);
	}
	
	public void setMapSet(GameObjectQueue mapSet) {
		this.mapSet = mapSet;
	}

	public String getLevelName() {
		return levelName;
	}

	public GameObjectQueue getMapSet() {
		return mapSet;
	}
	
	/**
	 * 查找ID对应的地图(SimpleMap对象)
	 * @param mapID 地图ID 
	 * @return 如果查找到,则返回查找到的ID对应的地图,否则返回null
	 */
	public SimpleMap findMap(String mapID){
		if (mapSet.containsKey(mapID)){
			return (SimpleMap)mapSet.get(mapID);
		}
		else{
			return null;
		}
	}

	public String getFirstMapID() {
		return firstMapID;
	}
	
	public String toString(){
		return "id="+super.toString()
		+" levelName="+levelName
		+" firstMapID="+firstMapID
		+" mapSet size="+mapSet.size();
	}

}

⌨️ 快捷键说明

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