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

📄 levelhandler.java

📁 monkeymahjongg,一个JME3D游戏的源代码
💻 JAVA
字号:
package jmetest.monkeymahjongg.playground.model;

import java.util.Vector;

import org.xml.sax.Attributes;
import org.xml.sax.helpers.DefaultHandler;

public class LevelHandler extends DefaultHandler {

	private int line = 0;
	//String name;
	int width, height, depth;
	Vector<String> lines = new Vector<String>(); 

	public LevelHandler() {
	}

	@Override
	public void startElement(String uri, String localName, String qName,
			Attributes attributes) {
		if ("mahjongg".equals(qName)) {
			//name = attributes.getValue("name");
			width = Integer.valueOf(attributes.getValue("width"));
			height = Integer.valueOf(attributes.getValue("height"));
			depth = Integer.valueOf(attributes.getValue("layers"));
		} else if ("line".equals(qName)) {
			String data = attributes.getValue("data");
			lines.add(data);
			line++;
		}
	}
}

⌨️ 快捷键说明

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