Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void examine(Command command){
- if(command.hasSecondWord()) {
- display("Type the name of the item you want to examine");
- return;
- }
- String itemToExamine = command.getSecondWord();
- // Copy the Hash from the current room into a new tempHash here
- tempHash = new HashMap();
- if(tempHash.containsKey(itemToExamine))
- {
- display("No such item here");
- }
- else {
- Item tempItem = tempHash.get(itemToExamine);
- display(tempItem.printMethod());
- }
- }
- }
Add Comment
Please, Sign In to add comment