forked from aryanch22/PlanetHoppingGame
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRoomOneInput.java
More file actions
78 lines (70 loc) · 2.69 KB
/
RoomOneInput.java
File metadata and controls
78 lines (70 loc) · 2.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import java.util.*;
import java.io.*;
/**
* Write a description of class RoomOneInput here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class RoomOneInput
{
PlanetHades Hades = new PlanetHades();
PlanetHades.roomOne direction = Hades.new roomOne();
Commands I = new Commands();
public void R1() throws Exception{
direction.readRoomFile();
direction.readCharacterFile();
ArrayList<String> wentTo = new ArrayList<String>(5);
do{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String userInput = reader.readLine();
userInput = userInput.toLowerCase();
if(wentTo.contains(userInput)){
System.out.println("I already went that way, no point in going back");
}
if(userInput.contains("east") && !wentTo.contains("east")){
wentTo.add("east");
direction.FirstEast();
}else if(userInput.contains("west") && !wentTo.contains("west")){
wentTo.add("west");
direction.West();
}else if(userInput.contains("south") && !wentTo.contains("south")){
wentTo.add("south");
direction.South();
}else if(userInput.contains("north") && !wentTo.contains("north")){
wentTo.add("north");
direction.North();
break;
}else if(userInput.contains("inventory")){
I.Inventory();
}else{
direction.readRoomFile();
}
}while(true);
}
public void R1Return() throws Exception{
direction.RunBack();
do{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String userInput = reader.readLine();
userInput = userInput.toLowerCase();
if(userInput.contains("hand") && userInput.contains("over")){
direction.HandOver();
break;
}else{
System.out.println("you should prabably handover the diamond you found");
}
}while(true);
do{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String userInput = reader.readLine();
userInput = userInput.toLowerCase();
if(userInput.contains("east")){
direction.SecondEast();
break;
}else{
System.out.println("Theres no time we better find that monster quickly");
}
}while(true);
}
}