SYSC 2004 Lecture Notes - Lecture 5: Interactive Fiction, Adventure Game, Dynamic Array

49 views2 pages

Document Summary

Import java. util. set; import java. util. hashmap; import java. util. iterator; import java. util. * class room - a room in an adventure game. * this class is part of the "world of zuul" application. * "world of zuul" is a very simple, text based adventure game. * a "room" represents one location in the scenery of the game. * stores a reference to the neighboring room. * @author michael kolling and david j. barnes. * @version october 21, 2012 public class room private string description; private hashmap exits; // stores exits of this room. private arraylist items; * @param description the room"s description. public room(string description) this. description = description; exits = new hashmap(); items = new arraylist(); * @param item adds items to the array list public void additem(item item){ items. add(item); * @param direction the direction of the exit. * @param neighbour the room to which the exit leads public void setexit(string direction, room neighbour) exits. put(direction, neighbour);

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents