ace

processCommand

ace
Jul 28th, 2010
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. private boolean processCommand(Command command)
  2. {
  3. boolean wantToQuit = false;
  4.  
  5. if(command.isUnknown()) {
  6. System.out.println("I don't know what you mean...");
  7. return false;
  8. }
  9.  
  10. String commandWord = command.getCommandWord();
  11. if (commandWord.equals("help"))
  12. printHelp();
  13. else if (commandWord.equals("go"))
  14. goRoom(command);
  15. else if (commandWord.equals("look"))
  16. look();
  17. else if (commandWord.equals("quit"))
  18. wantToQuit = quit(command);
  19. else if (commandWord.equals("defuse"))
  20. defuse();
  21.  
  22. return wantToQuit;
  23. }
Add Comment
Please, Sign In to add comment