Guest User

Untitled

a guest
Jun 23rd, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. private void examine(Command command){
  2. if(command.hasSecondWord()) {
  3. display("Type the name of the item you want to examine");
  4. return;
  5. }
  6.  
  7. String itemToExamine = command.getSecondWord();
  8. // Copy the Hash from the current room into a new tempHash here
  9. tempHash = new HashMap();
  10.  
  11.  
  12. if(tempHash.containsKey(itemToExamine))
  13. {
  14. display("No such item here");
  15. }
  16. else {
  17. Item tempItem = tempHash.get(itemToExamine);
  18. display(tempItem.printMethod());
  19. }
  20. }
  21.  
  22. }
Add Comment
Please, Sign In to add comment