import words through file
This commit is contained in:
@@ -140,24 +140,22 @@ class Game {
|
||||
}
|
||||
String commandWord = command.getCommandWord();
|
||||
switch(commandWord) {
|
||||
case "n": case "s": case "e": case "w": case "north": case "south": case "west": case "east": case "up": case "down":
|
||||
case "go": case "n": case "s": case "e": case "w": case "north": case "south": case "west": case "east": case "up": case "down":
|
||||
goRoom(command);
|
||||
break;
|
||||
|
||||
}
|
||||
if (commandWord.equals("help"))
|
||||
printHelp();
|
||||
else if (commandWord.equals("go"))
|
||||
goRoom(command);
|
||||
else if (commandWord.equals("jump"))
|
||||
System.out.println("Good Job!");
|
||||
else if (commandWord.equals("quit")) {
|
||||
if (command.hasSecondWord())
|
||||
System.out.println("Quit what?");
|
||||
else
|
||||
return true; // signal that we want to quit
|
||||
} else if (commandWord.equals("eat")) {
|
||||
System.out.println("Do you really think you should be eating at a time like this?");
|
||||
case "help":
|
||||
printHelp();
|
||||
break;
|
||||
case "jump":
|
||||
System.out.println("Good Job!");
|
||||
break;
|
||||
case "quit":
|
||||
return true;
|
||||
case "eat":
|
||||
System.out.println("Do you really think you should be eating at a time like this?");
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user