俄罗斯方块1.0
2014-08-23 13:38
141 查看
package config;
import java.io.Serializable;
import org.dom4j.Element;
public class ButtonConfig implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
private final int buttonW;
private final int buttonH;
private final int startX;
private final int startY;
private final int userConfigX;
private final int userConfigY;
// 读取配置文件
public ButtonConfig(Element button) {
this.buttonW = Integer.parseInt(button.attributeValue("w"));
this.buttonH = Integer.parseInt(button.attributeValue("h"));
this.startX = Integer.parseInt(button.element("start").attributeValue("x"));
this.startY = Integer.parseInt(button.element("start").attributeValue("y"));
this.userConfigX = Integer.parseInt(button.element("userConfig").attributeValue("x"));
this.userConfigY = Integer.parseInt(button.element("userConfig").attributeValue("y"));
}
public int getButtonW() {
return buttonW;
}
public int getButtonH() {
return buttonH;
}
public int getStartX() {
return startX;
}
public int getStartY() {
return startY;
}
public int getUserConfigX() {
return userConfigX;
}
public int getUserConfigY() {
return userConfigY;
}
}
import java.io.Serializable;
import org.dom4j.Element;
public class ButtonConfig implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
private final int buttonW;
private final int buttonH;
private final int startX;
private final int startY;
private final int userConfigX;
private final int userConfigY;
// 读取配置文件
public ButtonConfig(Element button) {
this.buttonW = Integer.parseInt(button.attributeValue("w"));
this.buttonH = Integer.parseInt(button.attributeValue("h"));
this.startX = Integer.parseInt(button.element("start").attributeValue("x"));
this.startY = Integer.parseInt(button.element("start").attributeValue("y"));
this.userConfigX = Integer.parseInt(button.element("userConfig").attributeValue("x"));
this.userConfigY = Integer.parseInt(button.element("userConfig").attributeValue("y"));
}
public int getButtonW() {
return buttonW;
}
public int getButtonH() {
return buttonH;
}
public int getStartX() {
return startX;
}
public int getStartY() {
return startY;
}
public int getUserConfigX() {
return userConfigX;
}
public int getUserConfigY() {
return userConfigY;
}
}
相关文章推荐
- 俄罗斯方块1.0(支持录像)
- J2ME游戏俄罗斯方块的设计与改良
- C#编写的一个俄罗斯方块游戏
- 逐步讲解用C#实现俄罗斯方块之核心代码[中]
- 2014年4月11日星期五java学习进程-面向对象和俄罗斯方块7个格子类的建立
- 史上最短小精悍的javascript编写的俄罗斯方块游戏,仅仅60行代码
- Java实现俄罗斯方块
- 对于俄罗斯方块的方块的设计是这样的。。。
- 60行代码:Javascript 写的俄罗斯方块游戏
- 命令行之俄罗斯方块
- 一个基于Yahoo UI的Ajax俄罗斯方块游戏
- Qt 俄罗斯方块一
- 【转】shell脚本写的俄罗斯方块游戏
- 一个基于Yahoo UI的Ajax俄罗斯方块游戏
- 俄罗斯方块学习视频
- 俄罗斯方块游戏java代码
- Python使用pygame模块编写俄罗斯方块游戏的代码实例
- 俄罗斯方块可以永无止境地玩下去吗?
- shell中俄罗斯方块
- 俄罗斯方块可以永无止境地玩下去吗?