📄 weapon.java
字号:
package dungeonsanddragons.model.weapons;import dungeonsanddragons.model.*;/** * Class to represent a weapon * A weapon is also a thing (can be picked up) which is also a showable (can be showed in a room) * @author Sandra Nilsson */public class Weapon extends Thing { /**The strenght (power) of this weapon*/ protected int strenght; /** * Create a new weapon * @param imgName file name of the image representing the weapon */ public Weapon (String imgName) { super(imgName); } /** * * @return the strenght of this weapon */ public int getStrenght () { return strenght; } /** * Give this weapon to the player * @param p1 the player that picks this weapon up */ public void giveTo(Player p1) { p1.addWeapon(this); currentRoom.setItem(null); this.currentRoom = null; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -