?? 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 + -