示例#1
0
 public void Travel(Room targetRoom)
 {
     CurrentRoom = targetRoom;
     Hero.CurrentRoom = targetRoom;
     CurrentRoom.Describe();
 }
示例#2
0
 public Room(string name, string desc, Room n, Room e, Room s, Room w, Room u, Room d)
     : this(name, desc)
 {
     if (n != null) LinkRooms(n, suds.Directions.North);
     if (s != null) LinkRooms(s, suds.Directions.South);
     if (e != null) LinkRooms(e, suds.Directions.East);
     if (w != null) LinkRooms(w, suds.Directions.West);
     if (u != null) LinkRooms(u, suds.Directions.Up);
     if (d != null) LinkRooms(d, suds.Directions.Down);
 }
示例#3
0
 public void LinkRooms(Room other, suds.Directions direction)
 {
     switch (direction)
     {
         case suds.Directions.North:
             this.North = other;
             other.South = this;
             break;
         case suds.Directions.East:
             this.East = other;
             other.West = this;
             break;
         case suds.Directions.South:
             this.South = other;
             other.North = this;
             break;
         case suds.Directions.West:
             this.West = other;
             other.East = this;
             break;
         case suds.Directions.Up:
             this.Up = other;
             other.Down = this;
             break;
         case suds.Directions.Down:
             this.Down = other;
             other.Up = this;
             break;
     }
 }