Example #1
0
 public void TestGetExit()
 {
     Exit myExit = new Exit("you see a mound of paper to the south", gregsoffice);
     t127.ExitCollection.AddExit("south", myExit);
     Assert.AreSame(myExit,t127.ExitCollection.GetExit("south"));
     Assert.IsNull(t127.ExitCollection.GetExit("north"));
 }
Example #2
0
 public Boolean AddExit(String exitLabel, Exit theExit)
 {
     if (exits.ContainsKey(exitLabel))
         return false;
     exits.Add(exitLabel, theExit);
     return true;
 }
Example #3
0
 public void Init()
 {
     playerInput = new ParsedInput("look", new ArrayList());
     thePlayer = new Player("greg");
     t127 = new Location("a lecture theatre", "T127");
     Location gregsoffice = new Location("a spinning vortex of terror", "Greg's Office");
     southExit = new Exit("you see a mound of paper to the south", gregsoffice);
     t127.ExitCollection.AddExit("south", southExit );
     thePlayer.CurrentLocation = t127;
     handler = new CommandHandler();
     look = new LookCommand();
 }