加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Thing.java 889 Bytes
一键复制 编辑 原始数据 按行查看 历史
炎渊 提交于 2020-06-17 15:08 . 我的迷宫
public class Thing
{
private String name;
private int energy;
private int life;
private int attack;
private int defense;
public Thing(String name, int energy, int life, int attack, int defense) {
this.name = name;
this.energy = energy;
this.life = life;
this.attack = attack;
this.defense = defense;
}
public int getEnergy() {
return this.energy;
}
public String getName() {
return this.name;
}
public String toString() {
return "[名称:" + name +",能量:" + energy + ",生命:"+life+",攻击力:"+attack+",防御力:"+defense+ "]";
}
public int getLife() {
return this.life;
}
public int getAttack() {
return this.attack;
}
public int getDefense() {
return this.defense;
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化