?? door.java
字號(hào):
package dungeonsanddragons.model;/** * Class representing a door in the castle * @author Sandra Nilsson */public class Door { private Room r1; private Room r2; /** * Create a door from the room r1 * @param r1 the room that this door leads to/from */ public Door (Room r1) { this.r1 = r1; } public Room getR1() { return r1; } public void setR1(Room r1) { this.r1 = r1; } public Room getR2() { return r2; } public void setR2(Room r2) { this.r2 = r2; } /** * Walk through this door with the given player * @param p1 the player that walsk through this door * @param fromRoom the room that the player comes from */ public void walkThrough (Player p1, Room fromRoom) { if(fromRoom == r1){ //Change the current room of the player to the other one p1.setCurrentRoom(r2); } else { //Change the current room of the player to the other one p1.setCurrentRoom(r1); } }}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -