Esempio n. 1
0
        /// <summary>
        /// Handles the logic around updating the CurrentRoom
        /// </summary>
        /// <param name="roomId"></param>
        public static void MoveToRoom(RoomId roomId)
        {
            var newRoom = House.GetRoomById(roomId);

            if (newRoom != null)
            {
                CurrentRoom = newRoom;
                if (VisitedRooms.Contains(CurrentRoom))
                {
                    IO.OutputNewLine("You are now in the "
                                     + CurrentRoom.GetName() + ".");
                }
                else
                {
                    VisitedRooms.Add(CurrentRoom);
                    DisplayCurrentRoomDescription();
                }
            }
            else
            {
                // This should only be useful for debugging... should not happen during a normal game.
                IO.OutputNewLine("That room does not exist");
            }
        }