public void AddRoom(BasicRoom room)
 {
     if (RoomDoesNotExist(room.Id))
     {
         GameRooms.Add(room);
     }
 }
        public void ConnectRoom(Guid sourceRoomId, string direction, Guid destinationRoomId)
        {
            BasicRoom sourceRoom = GetRoom(sourceRoomId);

            if (sourceRoom.Id != Guid.Empty)
            {
                sourceRoom.AddRoomConnection(direction, destinationRoomId);
            }
        }
        public BasicRoom GetRoom(Guid roomId)
        {
            BasicRoom temp = new BasicRoom();

            for (int i = 0; i < GameRooms.Count; i++)
            {
                if (GameRooms[i].Id == roomId)
                {
                    temp = GameRooms[i];
                    i    = GameRooms.Count;
                }
            }

            return(temp);
        }
Exemple #4
0
        static void Setup()
        {
            pc.Stats.Constitution = 25;
            pc.GenerateInfo();
            pc.Name = "Jeremy";

            BasicRoom room1 = new BasicRoom();

            room1.SetRoomInfo("Town Square Central", "This is the main room in the game.  It's where merchants and players will gather.");
            rm.AddRoom(room1);

            BasicRoom room2 = new BasicRoom();

            room2.SetRoomInfo("Staging Area", "The staging area is where players will gather to spell up before they go out into the wilds.");
            rm.AddRoom(room2);

            rm.ConnectRoom(room1.Id, "west", room2.Id);
            rm.ConnectRoom(room2.Id, "east", room1.Id);
        }