
processCommand
By:
ace on
Jul 28th, 2010 | syntax:
None | size: 0.69 KB | hits: 19 | expires: Never
private boolean processCommand(Command command)
{
boolean wantToQuit = false;
if(command.isUnknown()) {
System.out.println("I don't know what you mean...");
return false;
}
String commandWord = command.getCommandWord();
if (commandWord.equals("help"))
printHelp();
else if (commandWord.equals("go"))
goRoom(command);
else if (commandWord.equals("look"))
look();
else if (commandWord.equals("quit"))
wantToQuit = quit(command);
else if (commandWord.equals("defuse"))
defuse();
return wantToQuit;
}