Beispiel #1
0
 //designated constructor
 public Room(string tag)
 {
     exits         = new Dictionary <string, Door>();
     this.tag      = tag;
     _delegate     = null;
     itemContainer = new ItemContainer();
     //uitemContainer = new UItemContainer();
 }
Beispiel #2
0
 public Door getExit(string exitName, IRoomDelagate rDelegate)
 {
     if (rDelegate == Delegate)
     {
         Door door = null;
         exits.TryGetValue(exitName, out door);
         return(door);
     }
     else
     {
         return(null);
     }
 }
Beispiel #3
0
 public string getExits(IRoomDelagate rDelegate)
 {
     if (rDelegate == Delegate)
     {
         string exitNames = "Exits:";
         Dictionary <string, Door> .KeyCollection keys = exits.Keys;
         foreach (string exitName in keys)
         {
             exitNames += " " + exitName;
         }
         return(exitNames);
     }
     else
     {
         return("???");
     }
 }