Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

processCommand

By: ace on Jul 28th, 2010  |  syntax: None  |  size: 0.69 KB  |  hits: 19  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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.     }