Пример #1
0
        protected int FindRoom(int sourceRoomNumber, int destinationRoomNumber)
        {
            Room sourceRoom      = building.FindRoomByRoomNumber(sourceRoomNumber);
            Room destinationRoom = building.FindRoomByRoomNumber(destinationRoomNumber);

            if (sourceRoom.Equals(destinationRoom))
            {
                Console.WriteLine("You are at your destination: " + destinationRoom);
                visitedRooms.Remove(sourceRoom);
                return(destinationRoomNumber);
            }

            TraverseRoomTransitions(sourceRoomNumber, destinationRoomNumber);
            return(sourceRoomNumber);
        }