Ejemplo n.º 1
0
        private static List<Room> CreateRooms(RoomParameters parameters)
        {
            var rooms = Enumerable
                .Repeat<Func<Room>>(() => CreateRoom(parameters), parameters.Count)
            #pragma warning disable CC0031 // Check for null before calling a delegate
                .Select(f => f())
            #pragma warning restore CC0031 // Check for null before calling a delegate
                .ToList();

            return rooms;
        }
Ejemplo n.º 2
0
 private static Room CreateRoom(RoomParameters parameters)
 {
     return new Room(
         StaticRandom.NextInclusive(parameters.MinWidth, parameters.MaxWidth),
         StaticRandom.NextInclusive(parameters.MinHeight, parameters.MaxHeight));
 }