📄 weapon.java
字号:
package org.su.demo.forge.items.Weapon;
import org.su.demo.forge.items.Ingredient.Ore;
import org.su.demo.forge.items.Ingredient.Potion;
import org.su.demo.forge.items.Ingredient.Primal;
/*
* 工厂类已经就绪,准备武器用到的材料
* 要锻造的武器的抽象基类
*/
public abstract class Weapon {
protected String weaponName;
//制作武器将用到的原料
protected Ore ore;
protected Primal primal;
protected Potion potion;
//抽象方法用来收集来自“材料工厂”的材料,在子类中实现
public abstract void prepare();
public void makeUp()
{
System.out.println("==========准备锻造==========");
}
public void make()
{
System.out.println("==========开始锻造==========");
System.out.println("放入材料:");
System.out.println(" " + ore.toString());
System.out.println(" " + primal.toString());
if(null!=potion){
System.out.println(" " + potion.toString());
}
}
public void makeEnd()
{
System.out.println("锻造成品:");
System.out.println(" " + this.getWeaponName());
System.out.println("==========锻造结束==========");
}
public String getWeaponName() {
return weaponName;
}
public void setWeaponName(String weaponName) {
this.weaponName = weaponName;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -