package mug13; import java.util.Vector; import java.util.Hashtable; /* * Creates a world testWorld and puts Sam, in the MathLAN, with the Pizza. * (except that this creator doesn't actually put the pizza into the mathlan, * sam can perform no actions on the pizza) * */ public class TC { public static void main(String[] args) throws NotHereException, InvalidTargetException, NameTakenException { //create the world WorldBuilder testBuilder = new WorldBuilderObject(); RealWorld testWorld = new RealWorld(testBuilder); //fill the world Hashtable samVerbs = new Hashtable(); Verb eat = new Eat(testBuilder); samVerbs.put("eat", eat); Verb say = new Say(testBuilder); samVerbs.put("say", say); Hashtable pizzaVerbs = new Hashtable(); pizzaVerbs.put("eat", new Integer(1)); Hashtable pizzaAttributes = new Hashtable(); pizzaAttributes.put("parts", new Integer(4)); Thing pizza = new ThingObject("pizza", "yummy, cheesy, Chicagoy goodness", pizzaVerbs, pizzaAttributes); testBuilder.addThing(pizza); Person Sam = new PersonObject("Samuel A. Rebelsky", "The nutty professor.", "male", "computer science", samVerbs, new Hashtable(), //attributes new Vector()); //stuff testBuilder.addPerson(Sam); Vector persons = new Vector(); persons.add(Sam); Place mathLAN = new PlaceObject("Teh MathLAN", "THE place to be.", new Vector(), //adjacents new Vector(), //stuff in room persons, //people in room new Hashtable()); //verbs testBuilder.addLocation(mathLAN); }//main() }//TestCreator.java